Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More β†’
Socket
Sign inDemoInstall
Socket

superjson

Package Overview
Dependencies
Maintainers
4
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superjson

  • 2.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.1M
increased by2.39%
Maintainers
4
Weekly downloads
Β 
Created

What is superjson?

Superjson is a flexible and powerful library for serializing JavaScript data structures, including those that are not supported by JSON, such as Dates, RegExps, Maps, Sets, and more. It allows for seamless serialization and deserialization of complex data types, making it easier to work with complex data in applications that require data persistence or transmission.

What are superjson's main functionalities?

Serialization of complex types

Superjson can serialize complex JavaScript types like Dates, Maps, and Sets into a string representation that can be easily transmitted or stored. Upon deserialization, these strings are converted back into their original complex types.

{"date": "2023-04-14T12:00:00.000Z", "map": "[[\"key1\",\"value1\"],[\"key2\",\"value2\"]]", "set": "[\"a\",\"b\",\"c\"]"}

Custom serialization

Developers can define custom serialization and deserialization logic for unsupported types or to override the default behavior for supported types. This feature enhances flexibility and control over how data is serialized.

{"customType": "SerializedValue"}

Other packages similar to superjson

FAQs

Package last updated on 05 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc