Skip to content

konforti/wasm-truncate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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