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

@amoutonbrady/lz-string

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amoutonbrady/lz-string

Modern port of LZ-String

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@amoutonbrady/lz-string

This is a modern port of the original lz-string.

What does modern means?

The project was not really supported and maintained anymore.

I rewrote it in modern javascript syntax, typescript, compiled it with esbuild and wrote tests with uvu.

The size is much smaller and it play nicer with modern bundlers.

Install

$ npm install @amoutonbrady/lz-string

Example

import { compress, decompress } from '@amoutonbrady/lz-string'

const compressed = compress('hello world')
const decompressed = decompress(compressed)

API

The API is the same as lz-string, minus a few methods that needs re-implementations:

  • compressToUTF16(input: string): string;
  • decompressFromUTF16(compressed: string): string;
  • compressToUint8Array(uncompressed: string): Uint8Array;
  • decompressFromUint8Array(compressed: Uint8Array): string;

compressToBase64(input: string): string;

decompressFromBase64(input: string): string | null;

compressToURL(input: string): string;

decompressFromURL(input: string): string | null;

compress(uncompressed: string): string;

decompress(compressed: null | string): string | null;

Keywords

FAQs

Package last updated on 10 Mar 2023

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