apg-conv is a data conversion tool. It can run as a command line application to convert files from one encoding to another. It also provides encoding and decoding functions accessible from node.js applications.
Its features and design have been specifically built as an aid to apg.html, a web-page-based APG parser generator and tester. It is not meant to compete with more complete tools like iconv and iconv-lite. Nonetheless, for the encodings that it supports, it provides an alternate choice.
The original purpose of apg-conv was a means of getting arbitrary, 32-bit integer character codes in and out of an HTML
<textarea>. The ABNF syntax that defines the phrases that APG parses is capable of defining character codes of arbitrary-sized integers. However, with a web-page-based application, input and output is essentially constrained to the ASCII text of
<input> HTML tags. (The HTML5 File and Directory API is not standardized and not considered here.) The encoding and decoding formats and methods neccesary to implement this eventually led to this stand-alone application.
For the command line tool:
npm install -g apg-conv
apg-conv -h (displays the help screen)
npm install apg-conv --save
var converter = require("apg-conv");
The documentation is in the code in
To generate the documentation, from the package directory:
npm install -g docco ./docco-gen
docs/index.html in any web browser to get started.