How to use the levelup.call 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 cshum / level-transactions / index.js View on Github external
options.db = txdown(db._levelup, options.createLock)
    location = db.location
  } else if (isFunction(db.sublevel) && isFunction(db.levelup)) {
    // db is sublevelup, get its levelup
    this._levelup = db.levelup()
    options.db = txdown(db.levelup(), options.createLock)
    location = db.location
  } else {
    // db is LevelUP, wrap txdown
    this._levelup = db
    options.db = txdown(db)
    location = ''
  }

  // LevelUP.call(this, options.db(location), options)
  LevelUP.call(this, location, options)

  var self = this
  this.once('closed', function () {
    self.emit('end', self.db._error)
    self.emit('release', self.db._error)
  })
}
github HR / CryptoSync / src / Db.js View on Github external
function Db (location) {
  // Initialize necessary methods/properties from levelup in this instance
  levelup.call(this, location)
}

levelup

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

MIT
Latest version published 3 years ago

Package Health Score

64 / 100
Full package analysis