@konforti/wasm-truncate

truncate texts on the web using wasm-bindgen

Stats

StarsIssuesVersionUpdatedCreatedSize
@konforti/wasm-truncate
0.0.33 years ago3 years agoMinified + gzip package size for @konforti/wasm-truncate in KB

Readme

wasm truncate

truncate texts by number of lines using wasm-bindgen.

Installation

    npm i -S @konforti/wasm-truncate

Usage

const truncate = async (elementId: string, lines: number) => {
    const module = await import('@konforti/wasm-truncate');
    module.run(elementId, lines);
};

truncate('long-text', 1);

Development

# Once
rustup target add wasm32-unknown-unknown
cargo +nightly install wasm-bindgen-cli
# Run example
npm start

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.