qb-json-tok-writer

2.1.1 • Public • Published

qb-json-tok-writer

npm downloads bitHound Dependencies dev dependencies code analysis

Quick JSON writer for transforming tokenized output from qb-json-tok back into JSON/UTF-8 output.

Complies with the 100% test coverage and minimum dependency requirements of qb-standard .

Install

npm install qb-json-tok-writer

API 1.x -> 2.x update

qb-json-tok-writer 2.1.0 works with the updated qb-json-tok 2.1.0 output. (versioning was kept in sync for clarity).

Example

var utf8 = require( 'qb-utf8-ez' );               // for transforming to/from UTF-8
var tokenize = require( 'qb-json-tok' );          
var writer = require( 'qb-json-tok-writer' );

var w = writer();
var dst = [];
var di = 0;
tokenize(
    utf8.buffer( '{ "a":1, "b": [1,2,3], "c": true, "d": null }' ),
    function() {
        di = w.write( arguments, dst, di );
    }
)
console.log( utf8.string( dst ) );

> {"a":1,"b":[1,2,3],"c":true,"d":null}

Package Sidebar

Install

npm i qb-json-tok-writer

Weekly Downloads

0

Version

2.1.1

License

ISC

Last publish

Collaborators

  • mvoss9000