Socket
Book a DemoInstallSign in
Socket

levelup-defaults

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

levelup-defaults

Change the defaults settings on a levelup instance by returning a new levelup instance that uses the same leveldown but different options

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
42
-31.15%
Maintainers
1
Weekly downloads
 
Created
Source

levelup-defaults

Change the defaults settings on a levelup instance by returning a new levelup instance that uses the same leveldown but different options.

npm install levelup-defaults

build status

Usage

var defaults = require('levelup-defaults')
var level = require('level')
var db = level('db')

// create a new levelup that uses binary encoding as default
var binaryDb = defaults(db, {valueEncoding:'binary'})

// create a new levelup that uses bytewise and json
var anotherDb = defaults(db, {keyEncoding:require('bytewise'), valueEncoding:'json'})

The original db is not mutated so any encoding settings on that are left unchanged.

License

MIT

FAQs

Package last updated on 10 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts