https://github.com/Level/levelup
A node.js wrapper for abstract-leveldown compliant stores
一个为实现抽象leveldown兼容存储器的node.js封装器
levelup
Introduction
Fast and simple storage. A Node.js wrapper for abstract-leveldown
compliant stores, which follow the characteristics of LevelDB.
快速简单存储。一个为实现抽象leveldown兼容存储器的node.js封装器,遵循了LevelDB的特性
LevelDB is a simple key-value store built by Google. It's used in Google Chrome and many other products. LevelDB supports arbitrary byte arrays as both keys and values, singular get, put and delete operations, batched put and delete, bi-directional iterators and simple compression using the very fast Snappy algorithm.
LevelDB是一个Google构建的简单的键值存储。在Google Chrome和其他产品中被使用。LevelDB支持抽象字节数组作为键和值,单一get, put 和delete操作,批处理的put 和delete操作,双向迭代和使用快速Snappy
算法进行简单压缩
LevelDB stores entries sorted lexicographically by keys. This makes the streaming interface of levelup
- which exposes LevelDB iterators as Readable Streams - a very powerful query mechanism.
LevelDB存储按照键的字母顺序进行排序的条目。这构造了levelup
的流接口-暴露了levelup
作为可读流的迭代器-一个十分有效的查询机制
The most common store is leveldown
which provides a pure C++ binding to LevelDB. Many alternative stores are availablesuch as level.js
in the browser or memdown
for an in-memory store. They typically support strings and Buffers for both keys and values. For a richer set of data types you can wrap the store with encoding-down
.
最普遍的存储器是提供了存C++链接到LevelDB的leveldown
。有很多交替存储是可用的,如在浏览器中的level.js,或者是内存存储的memdown.他们的键和值基本上之处字符串和Buffers类型。对于更丰富的数据类型集,你可以使用encoding-down来封装该存储
The level
package is the recommended way to get started. It conveniently bundles levelup
, leveldown
and encoding-down
. Its main export is levelup
- i.e. you can do var db = require('level')
.
level包是推荐的入门方法。它有着levelup
, leveldown
和
encoding-down三部分。
主要的接口是level-比如使用var db = require('level')
Supported Platforms支持平台
We aim to support Active LTS and Current Node.js releases as well as browsers. For support of the underlying store, please see the respective documentation.
我们的目的是支持可用的LTS和当前的node.js以及浏览器。为了支持下面的存储,请查看相应的文档
Usage使用
If you are upgrading: please see UPGRADING.md
.
如果更新:请看UPGRADING.md
First you need to install levelup
! No stores are included so you must also install leveldown
(for example).
首先安装levelup
!没有包含的存储器,所有还要安装leveldown