Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added output examples to close #2 - good idea
- Loading branch information
1 parent
8a1b848
commit d4ad116
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var Cryo = require('../lib/cryo'); | ||
|
||
var obj = { | ||
name: 'Hunter', | ||
created: new Date(), | ||
hello: function() { | ||
console.log(this.name + ' said hello in ' + this.created.getFullYear() + '!'); | ||
} | ||
}; | ||
|
||
var frozen = Cryo.stringify(obj); | ||
|
||
console.log("Stringified cryo objects look like this:\n\n"); | ||
console.log(frozen); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"root":"_CRYO_REF_2", | ||
"references":[ | ||
{ | ||
"contents": {}, | ||
"value":"_CRYO_DATE_1358245390835" | ||
}, | ||
{ | ||
"contents": {}, | ||
"value":"_CRYO_FUNCTION_function () {\n console.log(this.name + ' said hello in ' + this.created.getFullYear() + '!');\n }" | ||
}, | ||
{ | ||
"contents":{ | ||
"name":"Hunter", | ||
"created":"_CRYO_REF_0", | ||
"hello":"_CRYO_REF_1" | ||
}, | ||
"value":"_CRYO_OBJECT_" | ||
} | ||
] | ||
} |