Skip to content

Commit

Permalink
Merge pull request #21 from nicojs/add-deserialisation-readme
Browse files Browse the repository at this point in the history
docs(readme): Add message about deserializing
  • Loading branch information
ericf committed Sep 2, 2016
2 parents 457a4c6 + fa9ca1d commit adfee60
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -88,6 +88,18 @@ This option is a signal to `serialize()` that the object being serialized does n
serialize(obj, {isJSON: true});
```

## Deserializing

For some use cases you might also need to deserialize the string. This is explicitely not part of this module. However, you can easily write it yourself:

```js
function deserialize(serializedJavascript){
return eval('(' + serializedJavascript + ')');
}
```

**Note:** Don't forget the parentheses around the serialized javascript, as the opening bracket `{` will be considered to be the start of a body.

## License

This software is free to use under the Yahoo! Inc. BSD license.
Expand Down

0 comments on commit adfee60

Please sign in to comment.