node-stringify
Stringify javascript objects and retrieve with eval
.
Important notes
This library IS NOT designed to replace JSON.stringify
. Unless you truly understand what this library does, I suggest you use JSON.stringify
in the first place.
Install
npm install node-stringify --save
Example
var stringify = ;console;console;console;console;console;console;console;// The parenthesis is to make the result work with `eval`console;console;// You can turn off the parenthesis tooconsole;console;
Supported types
- null
- undefined
- number
- string
- date
- regexp
- function
- array
- object
JSON.stringify
Difference with - The result of
node-stringify
can be retrieved directly usingeval
(Please be aware thateval
may be insecure).
Known issues
- Not support objects with circular references or too deeply nested(implemented in a recursive way).
License
MIT License.