How to use level-js - 6 common examples

To help you get started, we’ve selected a few level-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JamesKyburz / level-airplanedb / test / simple.js View on Github external
test('cleanup', function (t) {
    leveljs.destroy(name, function () {})
    t.end()
  })
}
github VirgilSecurity / virgil-e3kit-js / packages / e3kit-browser / src / EThree.ts View on Github external
});
        const keyLoader = new PrivateKeyLoader(identity, {
            accessTokenProvider,
            virgilCrypto,
            brainKeyCrypto,
            keyEntryStorage,
            apiUrl: opts.apiUrl,
        });
        const cardManager = new CardManager({
            cardCrypto,
            cardVerifier,
            accessTokenProvider,
            retryOnUnauthorized: true,
            apiUrl: opts.apiUrl,
        });
        const groupStorageLeveldown = leveljs(opts.groupStorageName!);

        return {
            identity,
            virgilCrypto,
            cardManager,
            accessTokenProvider,
            keyEntryStorage,
            keyLoader,
            groupStorageLeveldown,
        };
    }
github WorldBrain / Memex / src / search / search-index-old / level-js-to-leveldown.js View on Github external
constructor(location) {
        super(location)
        this.instance = leveljs(location)
    }
github neo-one-suite / neo-one / packages / neo-one-node-browser / src / FullNode.ts View on Github external
private async startInternal(): Promise {
    const primaryPrivateKey = common.stringToPrivateKey(constants.PRIVATE_NET_PRIVATE_KEY);
    const primaryPublicKey = common.stringToECPoint(constants.PRIVATE_NET_PUBLIC_KEY);
    crypto.addPublicKey(primaryPrivateKey, primaryPublicKey);

    const settings = createMain({
      address: common.uInt160ToString(crypto.privateKeyToScriptHash(primaryPrivateKey)),
      standbyValidators: [common.ecPointToString(primaryPublicKey)],
      privateNet: true,
    });
    const storage = levelupStorage({
      db: LevelUp(this.options.type === 'persistent' ? Level(this.options.id) : MemDown()),
      context: { messageMagic: settings.messageMagic },
    });

    const blockchain = await Blockchain.create({
      settings,
      storage,
      vm,
    });
    const nodeOptions = {
      consensus: {
        privateKey: common.privateKeyToString(primaryPrivateKey),
        privateNet: true,
      },
    };
    const node = new Node({
      blockchain,
github handshake-org / hsd / lib / db / level.js View on Github external
DB.destroy = function destroy(db, callback) {
  Level.destroy(db, callback);
};
github regular / ssb-cms / drafts.js View on Github external
destroy: function(cb) {
      require('level-js').destroy('drafts', cb)
    },

level-js

An abstract-leveldown compliant store on top of IndexedDB

MIT
Latest version published 3 years ago

Package Health Score

74 / 100
Full package analysis

Popular level-js functions