Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Mar 30, 2024 via pnpm

serialize-javascript 6.0.0

Serialize JavaScript to a superset of JSON that includes regular expressions and functions.
Package summary
Share
0
issues
2
licenses
2
MIT
1
BSD-3-Clause
Package created
16 Sep 2014
Version published
21 Jun 2021
Maintainers
3
Total deps
3
Direct deps
1
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
randombytes@2.1.0
safe-buffer@5.2.1

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
serialize-javascript@6.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of serialize-javascript 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
randombytes2.1.02.6 kBMIT
prod

Visualizations

Frequently Asked Questions

What does serialize-javascript do?

Serialize-javascript is a powerful npm package that converts JavaScript to a superset of JSON that includes regular expressions, functions, dates, sets, and maps. Its initial creation was as an internal module to express-state. However, due to its wide range of applicability, it now exists as serialize-javascript, a standalone package on npm. This tool allows seamless serialization of JavaScript on both the server and client sides and can be especially efficient for web applications using client-side URL routing.

How do you use serialize-javascript?

To use serialize-javascript, firstly, install the package using npm by running npm install serialize-javascript in your terminal. Once installed, import it in your JavaScript file with var serialize = require('serialize-javascript');. Then you can simply call serialize() function on your JavaScript object.

Example usage:

var serialize = require('serialize-javascript');

serialize({
    str  : 'string',
    num  : 0,
    obj  : {foo: 'foo'},
    arr  : [1, 2, 3],
    bool : true,
    nil  : null,
    undef: undefined,
    inf  : Infinity,
    date : new Date("Thu, 28 Apr 2016 22:02:17 GMT"),
    map  : new Map([['hello', 'world']]),
    set  : new Set([123, 456]),
    fn   : function echo(arg) { return arg; },
    re   : /([^\s]+)/g,
    big  : BigInt(10),
});

Where are the serialize-javascript docs?

The documentation for serialize-javascript can be found in the README file on the GitHub repository at git+https://github.com/yahoo/serialize-javascript.git. The README file is highly informative and contains a comprehensive guide on installation, usage, available options, and deserialization process.