Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including unserializable with all npm packages installed. Try it out:

var unserializable = require("unserializable")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

unserializable v0.1.0

Utilities for converting unserializable JavaScript objects and instances to serializable objects and vice versa.

unserializable

build status npm version npm downloads

Utilities for converting unserializable JavaScript objects and instances to serializable objects and vice versa.

Installation

npm install unserializable --save

Usage

This package exports the following:

  • unserializable - An object containing functions that will convert a serializable value to its unserializable form based on its type key.

  • serializable - An object containing functions that will convert an unserializable value to its serializable form based on its type key.

  • getType(value) - Gets the type of some value if it's unserializable.

Currently, the following types are supported:

  • Map - ES6 Map instance
  • Set - ES6 Set instance
  • Date - Date instance
  • RegExp - RegExp instance

Feel free to submit pull requests for more types!

Example

See redux-replicate-localforage.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free