Serialize JavaScript

Serialize JavaScript to a superset of JSON that includes regular expression...

README

Serialize JavaScript
====================

Serialize JavaScript to a _superset_ of JSON that includes regular expressions, dates and functions.
[![npm Version][npm-badge]][npm] [![Dependency Status][david-badge]][david] [![Build Status][travis-badge]][travis]

Overview


The code in this package began its life as an internal module to [express-state][]. To expand its usefulness, it now lives as serialize-javascript — an independent package on npm.

You're probably wondering: What about JSON.stringify()!? We've found that sometimes we need to serialize JavaScript functions, regexps, dates, sets or maps. A great example is a web app that uses client-side URL routing where the route definitions are regexps that need to be shared from the server to the client. But this module is also great for communicating between node processes.

The string returned from this package's single export function is literal JavaScript which can be saved to a `.js` file, or be embedded into an HTML document by making the content of a `