How to use encoding-down - 6 common examples

To help you get started, we’ve selected a few encoding-down 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 polkadot-js / common / packages / trie-db-old / src / encoder / index.ts View on Github external
function encoder (db: LevelUp$AbstractStorage) {
  return encodingDown(db, options);
}
github codius / codiusd / src / util / CodiusDB.ts View on Github external
constructor (deps: Injector) {
    this.config = deps(Config)

    let backend
    if (this.config.memdownPersist || this.config.devMode) {
      backend = memdown()
    } else {
      backend = leveldown(resolvePath(this.config.codiusRoot, 'codius.db'))
    }
    this.db = levelup(encode(backend, { valueEncoding: 'json' }))
  }
github LiskArchive / lisk-elements / packages / lisk-db / src / index.ts View on Github external
public constructor(file: string) {
		logger('opening file', { file });
		this._db = levelup(EncodingDown(RocksDB(file), { valueEncoding: 'json' }));
	}
github molily / universal-progressive-todos / src / data / Database.js View on Github external
constructor(filename) {
    this.db = levelup(encode(leveldown(filename), {
      valueEncoding: 'json'
    }));
  }
github PAIR-code / federated-learning / src / server / model_db.ts View on Github external
async setup(model?: FederatedModel) {
    this.db = await LevelUp(
        EncodingDown(LevelDown(this.dataDir), {valueEncoding: 'json'}));
    try {
      this.modelId = await this.db.get('currentModelId');
    } catch {
      const dict = await model.setup();
      await this.writeNewVars(dict.vars as tf.Tensor[]);
    }
  }

encoding-down

An abstract-leveldown implementation that wraps another store to encode keys and values

MIT
Latest version published 3 years ago

Package Health Score

68 / 100
Full package analysis

Popular encoding-down functions