1.1.1 • Published 7 years ago

fbbk-json v1.1.1

Weekly downloads
34
License
MIT
Repository
github
Last release
7 years ago

Fk JSON

fbbk-json TravisCI Coveralls Dependency Status

Parse JSON-Object string (not normalized JSON string) into JSON object.

Installation

$ npm install fbbk-json --save

or

$ bower install fbbk-json --save

Usage

This package has only one function:

var fJSON = require("fbbk-json");
fJSON.parse(A_JSON_STRING);

BUT

This package support the JSON string that written down like a JSON object in javascript.

For example:

'{"foo": "bar","baz": true}'    <-- both JSON and fJSON are supported
'{foo: "bar",baz: true}'        <-- only fJSON supported! ٩(๑•̀ω•́๑)۶

So you can do that:

var json1 = '{,,"foo": "bar",,,"baz": true,,}';
var json2 = '{foo: \'bar\',baz: true,c:[]}';

JSON.parse(json1);              ///< SyntaxError: Unexpected token , in JSON at position 1
JSON.parse(json2);              ///< SyntaxError: Unexpected token f
fJSON.parse(json1);             ///< { foo: 'bar', baz: true }
fJSON.parse(json2);             ///< { foo: 'bar', baz: true, c: [] }   \(●´ϖ`●)/

Contribute

You're welcome to make pull requests!

「雖然我覺得不怎麼可能有人會關注我」

1.1.1

7 years ago

1.1.0

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago