How to use the levelup.default function in levelup

To help you get started, we’ve selected a few levelup 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 orbs-network / orbs-network-typescript / projects / libs / core-library-typescript / src / block-storage / leveldb-driver.ts View on Github external
public constructor(dbPath: string) {
    // Make sure that the DB directory exists.
    const directory = path.dirname(dbPath);
    mkdirp.sync(directory);

    // Open/create the blocks LevelDB database.
    this.db = levelup.default(leveldown(dbPath));
  }
github Picolab / pico-engine / packages / pico-engine-next / src / RulesetRegistry.ts View on Github external
constructor(engineHomeDir: string) {
    this.rulesetDir = path.resolve(engineHomeDir, "rulesets");
    this.db = level(
      encode(leveldown(path.resolve(engineHomeDir, "rulesets-db")), {
        keyEncoding: charwise,
        valueEncoding: safeJsonCodec
      })
    );
  }

levelup

Fast & simple storage - a Node.js-style LevelDB wrapper

MIT
Latest version published 3 years ago

Package Health Score

61 / 100
Full package analysis