Nested Parenthetical Madness
    Wondering what’s next for npm?Check out our public roadmap! »

    @kvs/localstorage
    TypeScript icon, indicating that this package has built-in type declarations

    1.2.0 • Public • Published

    @kvs/localstorage

    localstorage for KVS.

    Install

    Install with npm:

    npm install @kvs/localstorage
    

    Usage

    import assert from "assert";
    import { kvsLocalStorage } from "@kvs/localstorage";
    (async () => {
        type StorageSchema = {
            a1: string;
            b2: number;
            c3: boolean;
        };
        const storage = await kvsLocalStorage<StorageSchema>({
            name: "test",
            version: 1
        });
        await storage.set("a1", "string");
        await storage.set("b2", 42);
        await storage.set("c3", false);
        const a1 = await storage.get("a1");
        const b2 = await storage.get("b2");
        const c3 = await storage.get("c3");
        assert.strictEqual(a1, "string");
        assert.strictEqual(b2, 42);
        assert.strictEqual(c3, false);
    })();

    Changelog

    See Releases page.

    Running tests

    Install devDependencies and Run npm test:

    npm test
    

    Contributing

    Pull requests and stars are always welcome.

    For bugs and feature requests, please create an issue.

    1. Fork it!
    2. Create your feature branch: git checkout -b my-new-feature
    3. Commit your changes: git commit -am 'Add some feature'
    4. Push to the branch: git push origin my-new-feature
    5. Submit a pull request :D

    Author

    License

    MIT © azu

    Install

    npm i @kvs/localstorage

    DownloadsWeekly Downloads

    3

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    9.79 kB

    Total Files

    10

    Last publish

    Collaborators

    • avatar