npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

zero-store

v0.0.4

Published

zero-store - Immutable Zero Knowledge store

Readme

zero-store

Zero Knowledge store.

  • immutable data store
  • secure and JWT based

How to use?

        const assert = require('assert');
        const {Store} = require('zero-store');

        let store = new Store({secret: 'secret....'});
        
        let user = {
            name: 'slava',
        };

        return store
            .save(user)
            .then((user) => store.get(user.id))
            .then((result) => {
                console.log(result);

                // { name: 'slava',
                //     id: 'id....' }

                delete result.id;

                assert.deepEqual(
                    {
                        name: 'slava',
                    }
                    , user)
            });

Spec

const assert = require('assert');
const {Store} = require('..');

describe('test', () => {
    let store;
    beforeEach(() => store = new Store({secret: 'secret....'}));

    it('save data', () => {
        return store
            .save({
                name: 'slava',
            })
            .then((user) => {
                assert.equal(user.name, 'slava');
                assert.equal(true, !!user.id);
            });
    });

    it('get data', () => {
        let user = {
            name: 'slava',
        };

        return store
            .save(user)
            .then((user) => store.get(user.id))
            .then((result) => {
                // console.log(result);

                // { name: 'slava',
                //     id: 'id....' }

                delete result.id;

                assert.deepEqual(
                    {
                        name: 'slava',
                    }
                    , user)
            });
    });

    it('test compressed store and uncompressed', () => {

        let store1 = new Store({secret: 'secret....', compression: false});  // by default
        let store2 = new Store({secret: 'secret....', compression: true});

        let user = {
            name: 'slava',
            about: `Lorem ipsum dolor sit amet Lorem ipsnce the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Lence the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Lence the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was adable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by ac popularised in the 1960s with the release of Leum dolor sit ametLorem ipsum dolor sit amet or at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section r, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined`
        };

        return Promise.resolve()
            .then(() => {
                return Promise.all([store1, store2]
                    .map((store) => store.save(user)))

                    .then(([user1, user2]) => {

                        return Promise.all([store1.get(user1.id), store2.get(user2.id)])
                            .then(([user1, user2]) => {


                                let id1 = user1.id;
                                let id2 = user2.id;

                                delete user1.id;
                                delete user2.id;

                                assert.deepEqual(user1, user2);
                                assert.equal(true, id1.length > id2.length);
                            })

                    })
            })
    });

    it('save and get data by ids[]', () => {
        let originUser1 = {
            name: 'slava'
        };

        let originUser2 = {
            name: 'plus'
        };

        return store
            .save([
                originUser1,
                originUser2,
            ])
            .then(([user1, user2]) => {
                assert.equal(user1.name, originUser1.name);
                assert.equal(user2.name, originUser2.name);

                let ids = [user1.id, user2.id];

                return store.get(ids)
                    .then(([user1, user2]) => {
                        assert.equal(user1.name, originUser1.name);
                        assert.equal(user2.name, originUser2.name);
                    });
            });
    });

    it('when save twice it should not grow', () => {
        return store
            .save({
                name: 'slava',
            })
            .then((user) => {
                let aUser = user;

                return store.save(user)
                    .then((user) => {
                        assert.equal(user.id, aUser.id);
                    });
            });
    });

    it('when data updated it gives new id, be careful its immutable, when you update model', () => {
        return store
            .save({
                name: 'slava',
            })
            .then((user) => {
                let aUser = Object.assign({}, user);
                user.name = 'xxxx';

                return store.save(user)
                    .then((user) => {
                        assert.notEqual(user.id, aUser.id);
                        assert.equal(aUser.name, 'slava');
                        assert.equal(user.name, 'xxxx');
                    });
            });
    });

});