Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: refactor

This branch is 0 commits ahead and 0 commits behind refactor

Octocat-spinner-32 test
Octocat-spinner-32 AUTHORS convert tabs to spaces February 09, 2012
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
Octocat-spinner-32 Sample output February 10, 2012
Octocat-spinner-32 sampleOutput.js


JASON is just like JSON, but unlike JSON it can:

  • serialize objects with methods
  • serialize objects with cyclic references
  • understand Dates, Regexps, Booleans, etc, and restore them with .parse() with their proper types/classes.
  • understand and serialize all the JS primitives, including undefined
  • properly recreate the holes in Arrays

JASON lets you pass objects as text between processes and/or threads.

Warning: unlike JSON, JASON is unsafe. You should only use it in contexts where you have strong guarantees that the strings that you pass to the JASON parser have been produced by a JASON formatter from a trusted source.


JASON syntax is just plain JavaScript (but not JSON).

The stringify function does the clever work of generating whatever Javascript is needed to recreate the object, and the parse function is just a call to eval.


See the test/test01.js file. sampleOutput.js has example output from running JASON.stringify(global) in Node.js.


var JASON = require("JASON");

str = JASON.stringify(obj);
obj = JASON.parse(str);


The easiest way to install JASON is with NPM:

npm install JASON


This work is licensed under the MIT license.

Something went wrong with that request. Please try again.