Serialize JavaScript to a superset of JSON that includes regular expressions, dates and functions. 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. A primary feature of this package is to serialize code to a string of literal JavaScript which can be embedded in an HTML document by adding it as the contents of the script element. In order to make this safe, HTML characters and JavaScript line terminators are escaped automatically.
Features
- Automatic Escaping of HTML Characters
- This module is also great for communicating between node processes.
- This software is free to use under the Yahoo! Inc. BSD license
- HTML characters and JavaScript line terminators are escaped automatically
- The string returned from this package's single export function is literal JavaScript
Categories
JSONLicense
BSD LicenseFollow Serialize JavaScript
Other Useful Business Software
Auth0 for AI Agents now in GA
Connect your AI agents to apps and data more securely, give users control over the actions AI agents can perform and the data they can access, and enable human confirmation for critical agent actions.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of Serialize JavaScript!