You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

strc

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strc

JavaScript String Compressor - lossless string compression algorithm

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
689
368.71%
Maintainers
1
Weekly downloads
 
Created
Source

JSSC

JSSC — JavaScript String Compressor

JSSC is an open-source, lossless string compression algorithm designed specifically for JavaScript strings (UTF-16). It produces compressed data that remains a valid JS string, making it ideal for environments where binary data is difficult to handle.

Note: The npm package is named strc.
The jssc ("jSSC") npm package is unrelated to this project.
Both names (uppercase "JSSC" and lowercase "strc") refer to the same project.

JSSC is a complex algorithm featuring multiple internal compression modes tailored for different data structures. During compression, each mode evaluates the input; if its specific conditions are met, it produces a candidate string. JSSC then selects the best candidate — the one that achieves the highest compression ratio while passing a mandatory lossless decompression check. This approach results in a slower compression phase but ensures high compression ratio and fast decompression, as no brute-forcing or validation is required during recovery.

⚠️ Compatibility Notice: Compressed strings from v1.x.x are not compatible with v2.x.x due to header and encoding changes. JSSC follows Semantic Versioning: successful decompression is guaranteed only if the decompressor version is equal to or newer than the compressor version (within the same major version).

Key Features

  • ~2.5:1 average compression ratio.
  • String-to-String: No binary buffers or external metadata.
  • Self-validating: Compressed string is guaranteed to be successfully decompressed and with no data loss (if the string is not corrupted and the string was compressed by same major and not larger minor and patch version following SemVer).
  • TypeScript support and fully-typed API.

Documentation

Full documentation, API reference, and live examples are available at jssc.js.org.

Quick start

npm i strc
import { compress, decompress } from 'strc';

const data = "Hello, world!";
const compressed = await compress(data);
const original = await decompress(compressed);

CLI:

npx jssc --help

Website/Browsers:

<script src="https://unpkg.com/justc"></script>
<script src="https://unpkg.com/strc"></script>
const data = "Hello, world!";
const compressed = await JSSC.compress(data);
const original = await JSSC.decompress(compressed);

Dependencies

JSSC depends on:

JSSC CLI and Format Handling (.jssc) depends on:

Note: All dependencies (except JUSTC) are bundled into the final build.

License

MIT © 2025-2026 JustDeveloper

Keywords

compressor

FAQs

Package last updated on 21 Mar 2026

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