UNPKG

cryonic

Version:

Easily pickle/serialize/freeze/store and re-hydrate complex JavaScript objects (including Functions)

9 lines (6 loc) 284 B
var Cryo = require('../lib/cryo'); var now = new Date(); var withJSON = JSON.parse(JSON.stringify(now)); console.log(withJSON instanceof Date); // false var withCryo = Cryo.parse(Cryo.stringify(now)); console.log(withCryo instanceof Date); // true