Socket
Socket
Sign inDemoInstall

compact-string

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    compact-string

Compact string encoding for Node.js


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
73.2 kB
Created
Weekly downloads
 

Readme

Source

compact-string

Compact string encoding for Node.js

Usage:

TypeScript: import { encode, decode, read, write } from 'compact-string';

JavaScript: const { encode, decode, read, write } = require('compact-string');

encode (string): CompactString;
decode (CompactString): string;
read[Sync] (filename, string);
write[Sync] (filename, string);

ByteArray = any Array<ints> or TypedArray<ints>

CompactString {
    constructor(from: number | string | ByteArray);

    get length(): number;
    get size(): number;

    write_code_point(n: number): this;
    write_string(str: string): this;
    write_buffer(b: ByteArray): this;

    next(): {
        value: string;
        done: boolean;
    };

    [Symbol.iterator](): {
        next: () => {
            value: string;
            done: boolean;
        };
    };

    get buffer(): Buffer;
    get string(): string;
}

FAQs

Last updated on 14 May 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc