datastore-level

2019-08-16

datastore-level是什么

什么是datastore-level,Datastore implementation with level(up|down) backend

datastore-level使用教程帮助文档

js-datastore-level

standard-readme compliantBuild StatusCodecovDependency Statusjs-standard-style

Datastore implementation with levelupbackend.

Lead Maintainer

Alex Potsides

Table of Contents

  • js-datastore-level
    • Lead Maintainer
    • Table of Contents
    • Install
    • Usage
      • Browser Shimming Leveldown
      • Database names
    • Contribute
    • License

Install

$ npm install datastore-level

Usage

const LevelStore = require('datastore-level')

// Default using level as backend for node or the browser
const store = new LevelStore('path/to/store')

// another leveldown compliant backend like memdown
const memStore = new LevelStore('my/mem/store', {
  db: require('level-mem')
})

Browser Shimming Leveldown

LevelStoreuses the levelmodule to automatically use level.jsif a modern bundler is used which can detect bundle targets based on the pkg.browserproperty in your package.json.

If you are using a bundler that does not support pkg.browser, you will need to handle the shimming yourself, as was the case with versions of LevelStore0.7.0 and earlier.

Database names

level-js@3changed the database prefix from IDBWrapper-to level-js-, so please specify the old prefix if you wish to continue using databases created using datastore-levelprior to v0.12.0. E.g.

const leveljs = require('level-js')
const browserStore = new LevelStore('my/db/name', {
  db: (path) => leveljs(path, {
    prefix: 'IDBWrapper-'
  })
})

More information: https://github.com/Level/level-js/blob/master/UPGRADING.md#new-database-prefix

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

License

MIT


上一篇:Jenkins与Rainbond对接部署应用
下一篇:fast-write-atomic
相关教程
关注微信

扫码加入 JavaScript 社区

相关文章

首次访问,需要验证
微信扫码,关注即可
(仅需验证一次)

欢迎加入 JavaScript 社区

号内回复关键字:

回到顶部