unpm-leveldb v0.4.3
μnpm-leveldb
leveldb backend for μnpm
API
This module exports an object with the following properties:
getUser(name, done): retrieve a user name, call a node style callback (function(error, data)) when it's been retrieved from the database.setUser(name, data, done): set a user name, along with aJSON.stringify-able blob of your user data. This should have keys:{ name: <username> , email: <email> , salt: <salt> , date: <date> , password_hash: <hashed_password> }It calls a node style callback (
function(error, data)) when it's been set in the database.createUserStream(options): create a readable stream of user entries as key value pairs.optionsis an optional object of the form of levelup's createReadStream() options.getMeta(name, done): retrieve a meta data for a username, call a node style callback (function(error, data)) when it's been retrieved from the database.setMeta(name, meta, done): Set meta-data for a package callednameand call a node style callback (function(error, data)) when it's been retrieved from the database.metais an object that looks like EXAMPLE-META-DATA.jsoncreateMetaStream(options): create a readable stream of meta data entries as key value pairs.optionsis an optional object of the form of levelup's createReadStream() options.
getTarball(name, version)->ReadableStream: Retrieve a package tarball from the database. This returns a byte stream of the.tgz.setTarball(name, version)->WritableStream: Create a writable stream which uploads the tarball to the DB. The tarball must conform to the specification described by npm-installget(name, done): retrieve value fornamein the arbitrary key/value store.set(name, data, done): savedatakeyed asnamein the arbitrary key/value store.createStream(option): create a readable stream of the entries in the arbitrary key/value store.optionsis an optional object of the form of levelup's createReadStream() options.
