compact-string
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-2 • Public • Published

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;
}

Readme

Keywords

none

Package Sidebar

Install

npm i compact-string

Weekly Downloads

8

Version

0.1.0-2

License

GPL-3.0-or-later

Unpacked Size

75 kB

Total Files

59

Last publish

Collaborators

  • realprokopschield