Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Autodesk/sjson

Repository files navigation

Simplified JSON Parser

A parser that converts SJSON into JSON.

Build Status

Installation

npm install --save simplified-json

Usage

description = "A sample, json document."
author = {
 	name = "Autodesk"
}
keywords = ["sample", "sjson"]

parse

Parse a sjson string and return a javascript object

var SJSON = require('simplified-json'),
  fs = require('fs');

fs.readFile('sample.sjson', 'utf8', function (err, data) {
  if (err) {
    return console.log(err);
  }
  console.log(SJSON.parse(data));
});

stringify

Parse a javascript object and return a sjson string

var SJSON = require('simplified-json'),
  fs = require('fs'),
  data = {
    keywords: [
    	"sample"
    	"sjson"
    ]
  };

fs.writeFile('sample.sjson', SJSON.stringify(data), 'utf8', function (err) {
  if (err) {
    return console.log(err);
  }
});

Featured In

About

Simplified JSON parser

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •