ctils
v0.0.3
Published
A collection of utility functions for various tasks. Licensed under MIT/Apache-2.0. Includes TypeScript support and compatible with both ESM and CJS import styles.
Downloads
4
Readme
ctils is a simple key-value store written in Rust ctils.
Built with 🦀🕸 by The Rust and WebAssembly Working Group
About
📚 Read this template tutorial! 📚
This template is designed for compiling Rust libraries into WebAssembly and publishing the resulting package to NPM.
Be sure to check out other wasm-pack
tutorials online for other
templates and usages of wasm-pack
.
🚴 Usage
🐑 Use npm install ctils
to use this package
npm install ctils
🛠️ Use In Your Pages
import * as rsStore from 'ctils';
const store = new rsStore.RsStore();
or
import { RsStore } from 'ctils';
const store = new RsStore();
🚴 Apis
store.set('key', 'value'); // ()=> viod
store.get('key'); // ()=> value | undefined
store.remove('key'); // ()=> value | undefined
store.clear(); // ()=> void
store.keys(); // ()=> Array<string>
store.values(); // ()=> Array<any>
store.size(); // ()=> number
store.has('key'); // ()=> boolean
store.get_all(); // ()=> JSON