|
1 | 1 | Serialize JavaScript |
2 | 2 | ==================== |
3 | | - |
4 | 3 | Serialize JavaScript to a _superset_ of JSON that includes regular expressions, dates and functions. |
5 | | - |
6 | | -[![npm Version][npm-badge]][npm] |
7 | | -[![Dependency Status][david-badge]][david] |
8 | | - |
| 4 | +This library is a fork of the [serialize-javacript] library that addresses browser compatibility by using the native crypto module. |
9 | 5 |
|
10 | 6 | ## Overview |
11 | | - |
12 | | -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. |
13 | | - |
14 | 7 | 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. |
15 | 8 |
|
16 | 9 | 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 `<script>` element. |
@@ -133,11 +126,7 @@ function deserialize(serializedJavascript){ |
133 | 126 | This software is free to use under the Yahoo! Inc. BSD license. |
134 | 127 | See the [LICENSE file][LICENSE] for license text and copyright information. |
135 | 128 |
|
136 | | - |
137 | | -[npm]: https://www.npmjs.org/package/serialize-javascript |
138 | | -[npm-badge]: https://img.shields.io/npm/v/serialize-javascript.svg?style=flat-square |
139 | | -[david]: https://david-dm.org/yahoo/serialize-javascript |
140 | | -[david-badge]: https://img.shields.io/david/yahoo/serialize-javascript.svg?style=flat-square |
141 | | -[express-state]: https://github.com/yahoo/express-state |
| 129 | +[serialize-javacript]: https://github.com/yahoo/serialize-javascript |
| 130 | +[npm]: https://www.npmjs.org/package/@namecheap/serialize-javascript |
142 | 131 | [JSON.stringify]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify |
143 | | -[LICENSE]: https://github.com/yahoo/serialize-javascript/blob/main/LICENSE |
| 132 | +[LICENSE]: https://github.com/namecheap/serialize-javascript/blob/main/LICENSE |
0 commit comments