node-mojangson

A mojangson parser written in node.js

WARNING: This project has been renamed to mojangson. Install using mojangson instead.
Last updated 11 years ago by rom1504 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install node-mojangson 
SYNC missed versions from official npm registry.

node-mojangson

NPM version Build Status

node-mojangson is a mojangson parser.

Mojangson specification

Mojangson is mojang's variant of json. It is basically json with the following changes :

  • array can be indexed (example : [0:"v1",1:"v2",2:"v3"])
  • array and object can have trailing comma (example : [5,4,3,] and {"a":5,"b":6,})
  • there can be string without quote (example : {mykey:myvalue})
  • numbers can be suffixed by b, s, l, f or the same in upper case (example : {number:5b})
  • mojangson stays a superset of json : every json is a mojangson

Parser

This parser is build using jison.

See the grammar and the examples in the test for more information.

Usage

Usage example :

var mojangson=require("mojangson");
console.log(mojangson.parse("{mykey:myvalue}"));

The provided method mojangson.parse return a javascript object corresponding to the mojangson passed in input.

Current Tags

  • 0.1.1                                ...           latest (11 years ago)

2 Versions

  • 0.1.1 [deprecated]           ...           11 years ago
  • 0.1.0 [deprecated]           ...           12 years ago
Maintainers (1)
Downloads
Total 18
Today 0
This Week 6
This Month 17
Last Day 2
Last Week 6
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE