Teleport JavaScript is a specialized utility for the deep serialization and deserialization of JavaScript objects, extending far beyond the capabilities of the native `JSON.stringify` and `JSON.parse` methods. Currently stable at version 1.0.0, this library provides robust handling for a wide array of data types including `Date`, `BigInt`, `RegExp`, `Symbol`, `Set`, `Map`, `Buffer`, `undefined`, and all Typed Arrays (e.g., `Int8Array`, `Float64Array`). A key differentiator is its ability to correctly manage circular references within objects, preventing common serialization errors. While a specific release cadence isn't published, its current version suggests a focus on stability for its comprehensive feature set. It positions itself as a 'super light and fast' alternative for scenarios where standard JSON falls short, making it suitable for inter-process communication, storage, or deep cloning of complex JavaScript data structures. It prioritizes covering edge cases and modern JavaScript types for complete object graph preservation.
npm install teleport-javascriptVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of `stringify` and `parse` for a complex object including `BigInt`, `RegExp`, `Set`, `Symbol`, `Date`, `undefined`, and circular references.
If exact `Symbol` reference preservation is critical, consider alternative strategies like passing `Symbol`s out-of-band or using a different serialization approach specifically designed for reference tracking beyond object graphs.
Avoid deserializing input from untrusted sources. If absolutely necessary, sanitize or validate inputs rigorously before passing them to `parse`, and implement robust error handling and resource limits.
Understand the full list of supported types and how they are handled. If strict `JSON.stringify` behavior is needed for a subset of the data, use `JSON.stringify` directly on that subset.
Change `const {parse, stringify} = require('teleport-javascript');` to `import { parse, stringify } from 'teleport-javascript';`Ensure you are using named imports: `import { parse, stringify } from 'teleport-javascript';` or `const { parse, stringify } = require('teleport-javascript');`Use `teleport-javascript`'s `stringify` function instead: `const stringified = stringify(objWithBigInt);`
No dependency data recorded yet.