JSPM

@c-collamar/psgc-transcoder

2.0.2
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q34590F
    • License ISC

    Convert PSGC data from Excel to programmer-friendly JSON.

    Package Exports

    • @c-collamar/psgc-transcoder

    Readme

    PSGC Transcoder

    Convert PSGC data from Excel* to programmer-friendly JSON. You can even customize what part of the PSGC data to only include in the generated JSON.

    Basic Usage

    1. Install this package.

      npm i -g @c-collamar/psgc-transcoder
    2. Use this package in two ways:

      • As an executable:

        psgc-t -i /path/to/input/psgc.csv -o /path/to/output/psgc.json
      • As a Node.js module:

        As an ES module:

        import { transcode } from '@c-collamar/psgc-transcoder'
        
        transcode('/path/to/input/psgc.csv', '/path/to/output/psgc.json');

        As a CommonJS module:

        const psgc = require('@c-collamar/psgc-transcoder');
        
        psgc.transcode('/path/to/input/psgc.csv', '/path/to/output/psgc.json');

    Additional Features

    View all the available options by running:

    psgc-t --help

    Motivation

    I wanted to use the Philippine Standard Geographic Code (PSGC) standard for one of my projects. The problem was that the PSGC is only being officially issued as an .xlsx document. This means bad news for programmers, because there's no direct way to pull PSGC data out of Excel and into the Node.js environment.

    I looked into existing PSGC implementations on the NPM registry. Unfortunately, none of them satisfy the storage efficiency requirement for my project. Some are even barely being maintained and their PSGC data is outdated.

    So, in an effort to make PSGC easier to work with, I have created this tool. I exchanged emails with PSA officials to make sure any assumptions I made while working on this package is in line with the standard they set.

    This transcoder is just one of the three components I'm working on to make PSGC easier to integrate not only into my projects, but yours as well. Another component is a PSGC reader, that queries data from the JSON generated by this transcoder.

    * Needs to be exported to CSV first, maybe for now at least.