Socket
Book a DemoSign in
Socket

strc

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

strc

JavaScript String Compressor - lossless string compression algorithm

unpublished
Source
npmnpm
Version
2.1.0-test.3
Version published
Weekly downloads
275
-43.99%
Maintainers
1
Weekly downloads
 
Created
Source

JSSC — JavaScript String Compressor

JSSC (JavaScript String Compressor) is an open-source, lossless string compression algorithm designed specifically for JavaScript.

It operates directly on JavaScript strings (UTF-16) and produces compressed data that is also a valid JavaScript string.

Key Features

  • Lossless compression
  • 🗜️ High compression ratios
    • up to 8:1 for numeric data
    • strong results for repetitive and structured text
  • 🌍 Multilingual support
    • English, Russian, Japanese, Chinese, Hindi, Bengali, and more
  • 📦 JSON support
    • JSON is converted to JUSTC before compression
  • ⚙️ String → String
    • no binary buffers
    • no external metadata
    • all required information is embedded into the compressed string itself
  • 🧠 Self-validating compression
    • every compression mode is verified by decompression before being accepted
  • 🔁 Recursive compression
  • 📜 TypeScript definitions included

Important Version Compatibility Notice

⚠️ Compressed strings produced by JSSC v1.x.x are NOT compatible with v2.x.x

Reasons:

  • The first 16 bits (header layout) were slightly redesigned
  • New compression modes were added
  • Character encoding tables were extended

Character Encoding

JSSC operates on JavaScript UTF-16 code units, not on UTF-8 bytes.

This means:

  • Any character representable in a JavaScript string is supported
  • Compression works at the UTF-16 level
  • One JavaScript character = 16 bits
  • Binary data must be converted to strings before compression

Project Name vs npm Package Name

The project is called JSSC (JavaScript String Compressor).

The npm package is published under the name strc, because the name jssc is already occupied on npm by an unrelated Java-based package.

Both names refer to the same project.

Installation

Install via npm

npm i strc

The npm package name is strc, but the library itself is JSSC.

Or you can use it on your website by inserting the following HTML script tags.

<script src="https://unpkg.com/justc"></script>
<script src="https://unpkg.com/strc"></script>

Usage

JavaScript

const { compress, decompress } = require('strc');

const example = await compress("Hello, world!");
await decompress(example);

TypeScript

import { compress, decompress } from 'strc';

const example = await compress("Hello, world!");
await decompress(example);

Deno (server-side)

import JSSC from 'https://jssc.js.org/jssc.min.js';

const example = await JSSC.compress("Hello, world!");
await JSSC.decompress(example);

Browsers / Frontend (UMD)

When using the UMD build via CDN, the library is exposed globally as JSSC.

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

JS API

compress(input: string | object | number): Promise<string>

Compresses the input and returns a compressed JavaScript string.

decompress(input: string, stringify?: boolean): Promise<string | object | number>

Decompresses a previously compressed string/object/integer.

CLI Usage

jssc --help

Compress a file/directory to JSSC Archive:

jssc <input>

Decompress a JSSC Archive:

jssc <input.jssc> -d

Dependencies

JSSC depends on:

JSSC CLI and Format Handling depends on:

License

MIT © 2025-2026 JustDeveloper

Keywords

compressor

FAQs

Package last updated on 13 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