Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

leveldown

Level1.8mMITdeprecated6.1.1TypeScript support: definitely-typed

Superseded by classic-level (https://github.com/Level/community#faq)

A low-level Node.js LevelDB binding

leveldb, level

readme

leveldown

level badge npm Node version Test Coverage Standard Common Changelog Donate

Table of Contents

<summary>Click to expand</summary>

Introduction

This module was originally part of levelup but was later extracted and now serves as a stand-alone binding for LevelDB.

It is strongly recommended that you use levelup in preference to leveldown unless you have measurable performance reasons to do so. levelup is optimised for usability and safety. Although we are working to improve the safety of the leveldown interface it is still easy to crash your Node process if you don't do things in just the right way.

See the section on safety below for details of known unsafe operations with leveldown.

Supported Platforms

We aim to support at least Active LTS and Current Node.js releases, Electron 5.0.0, as well as any future Node.js and Electron releases thanks to N-API. The minimum node version for leveldown is 10.12.0. Conversely, for node >= 12, the minimum leveldown version is 5.0.0.

The leveldown npm package ships with prebuilt binaries for popular 64-bit platforms as well as ARM, M1, Android and Alpine (musl) and is known to work on:

  • Linux (including ARM platforms such as Raspberry Pi and Kindle)
  • Mac OS (10.7 and later)
  • Solaris (SmartOS & Nodejitsu)
  • FreeBSD
  • Windows

When installing leveldown, node-gyp-build will check if a compatible binary exists and fallback to a compile step if it doesn't. In that case you'll need a valid node-gyp installation.

If you don't want to use the prebuilt binary for the platform you are installing on, specify the --build-from-source flag when you install. One of:

npm install --build-from-source
npm install leveldown --build-from-source

If you are working on leveldown itself and want to re-compile the C++ code, run npm run rebuild.

Notes

  • If you get compilation errors on Node.js 12, please ensure you have leveldown >= 5. This can be checked by running npm ls leveldown.
  • On Linux flavors with an old glibc (Debian 8, Ubuntu 14.04, RHEL 7, CentOS 7) you must either update leveldown to >= 5.3.0 or use --build-from-source.
  • On Alpine 3 it was previously necessary to use --build-from-source. This is no longer the case.
  • The Android prebuilds are made for and built against Node.js core rather than the nodejs-mobile fork.

API

If you are upgrading: please see UPGRADING.md.

db = leveldown(location)

Returns a new leveldown instance. location is a String pointing to the LevelDB location to be opened.

db.open([options, ]callback)

Open the store. The callback function will be called with no arguments when the database has been successfully opened, or with a single error argument if the open operation failed for any reason.

options

The optional options argument may contain:

  • createIfMissing (boolean, default: true): If true, will initialise an empty database at the specified location if one doesn't already exist. If false and a database doesn't exist you will receive an error in your open() callback and your database won't open.

  • errorIfExists (boolean, default: false): If true, you will receive an error in your open() callback if the database exists at the specified location.

  • compression (boolean, default: true): If true, all compressible data will be run through the Snappy compression algorithm before being stored. Snappy is very fast and shouldn't gain much speed by disabling so leave this on unless you have good reason to turn it off.

  • cacheSize (number, default: 8 * 1024 * 1024 = 8MB): The size (in bytes) of the in-memory LRU cache with frequently used uncompressed block contents.

Advanced options

The following options are for advanced performance tuning. Modify them only if you can prove actual benefit for your particular application.

  • writeBufferSize (number, default: 4 * 1024 * 1024 = 4MB): The maximum size (in bytes) of the log (in memory and stored in the .log file on disk). Beyond this size, LevelDB will convert the log data to the first level of sorted table files. From the LevelDB documentation:

Larger values increase performance, especially during bulk loads. Up to two write buffers may be held in memory at the same time, so you may wish to adjust this parameter to control memory usage. Also, a larger write buffer will result in a longer recovery time the next time the database is opened.

  • blockSize (number, default 4096 = 4K): The approximate size of the blocks that make up the table files. The size related to uncompressed data (hence "approximate"). Blocks are indexed in the table file and entry-lookups involve reading an entire block and parsing to discover the required entry.

  • maxOpenFiles (number, default: 1000): The maximum number of files that LevelDB is allowed to have open at a time. If your data store is likely to have a large working set, you may increase this value to prevent file descriptor churn. To calculate the number of files required for your working set, divide your total data by 'maxFileSize'.

  • blockRestartInterval (number, default: 16): The number of entries before restarting the "delta encoding" of keys within blocks. Each "restart" point stores the full key for the entry, between restarts, the common prefix of the keys for those entries is omitted. Restarts are similar to the concept of keyframes in video encoding and are used to minimise the amount of space required to store keys. This is particularly helpful when using deep namespacing / prefixing in your keys.

  • maxFileSize (number, default: 2* 1024 * 1024 = 2MB): The maximum amount of bytes to write to a file before switching to a new one. From the LevelDB documentation:

... if your filesystem is more efficient with larger files, you could consider increasing the value. The downside will be longer compactions and hence longer latency/performance hiccups. Another reason to increase this parameter might be when you are initially populating a large database.

db.close(callback)

close() is an instance method on an existing database object. The underlying LevelDB database will be closed and the callback function will be called with no arguments if the operation is successful or with a single error argument if the operation failed for any reason.

leveldown waits for any pending operations to finish before closing. For example:

db.put('key', 'value', function (err) {
  // This happens first
})

db.close(function (err) {
  // This happens second
})

db.put(key, value[, options], callback)

Store a new entry or overwrite an existing entry.

The key and value objects may either be strings or Buffers. Other object types are converted to strings with the toString() method. Keys may not be null or undefined and objects converted with toString() should not result in an empty-string. Values may not be null or undefined. Values of '', [] and Buffer.alloc(0) (and any object resulting in a toString() of one of these) will be stored as a zero-length character array and will therefore be retrieved as either '' or Buffer.alloc(0) depending on the type requested.

A richer set of data-types is catered for in levelup.

options

The only property currently available on the options object is sync (boolean, default: false). If you provide a sync value of true in your options object, LevelDB will perform a synchronous write of the data; although the operation will be asynchronous as far as Node is concerned. Normally, LevelDB passes the data to the operating system for writing and returns immediately, however a synchronous write will use fsync() or equivalent so your callback won't be triggered until the data is actually on disk. Synchronous filesystem writes are significantly slower than asynchronous writes but if you want to be absolutely sure that the data is flushed then you can use { sync: true }.

The callback function will be called with no arguments if the operation is successful or with a single error argument if the operation failed for any reason.

db.get(key[, options], callback)

Get a value from the LevelDB store by key.

The key object may either be a string or a Buffer and cannot be undefined or null. Other object types are converted to strings with the toString() method and the resulting string may not be a zero-length. A richer set of data-types is catered for in levelup.

Values fetched via get() that are stored as zero-length character arrays (null, undefined, '', [], Buffer.alloc(0)) will return as empty-String ('') or Buffer.alloc(0) when fetched with asBuffer: true (see below).

options

The optional options object may contain:

  • asBuffer (boolean, default: true): Used to determine whether to return the value of the entry as a string or a Buffer. Note that converting from a Buffer to a string incurs a cost so if you need a string (and the value can legitimately become a UTF8 string) then you should fetch it as one with { asBuffer: false } and you'll avoid this conversion cost.
  • fillCache (boolean, default: true): LevelDB will by default fill the in-memory LRU Cache with data from a call to get. Disabling this is done by setting fillCache to false.

The callback function will be called with a single error if the operation failed for any reason, including if the key was not found. If successful the first argument will be null and the second argument will be the value as a string or Buffer depending on the asBuffer option.

db.getMany(keys[, options][, callback])

Get multiple values from the store by an array of keys. The optional options object may contain asBuffer and fillCache, as described in get().

The callback function will be called with an Error if the operation failed for any reason. If successful the first argument will be null and the second argument will be an array of values with the same order as keys. If a key was not found, the relevant value will be undefined.

If no callback is provided, a promise is returned.

db.del(key[, options], callback)

Delete an entry. The key object may either be a string or a Buffer and cannot be undefined or null. Other object types are converted to strings with the toString() method and the resulting string may not be a zero-length. A richer set of data-types is catered for in levelup.

options

The only property currently available on the options object is sync (boolean, default: false). See db.put() for details about this option.

The callback function will be called with no arguments if the operation is successful or with a single error argument if the operation failed for any reason.

db.batch(operations[, options], callback) (array form)

Perform multiple put and/or del operations in bulk. The operations argument must be an Array containing a list of operations to be executed sequentially, although as a whole they are performed as an atomic operation.

Each operation is contained in an object having the following properties: type, key, value, where the type is either 'put' or 'del'. In the case of 'del' the value property is ignored.

Any entries where the key or value (in the case of 'put') is null or undefined will cause an error to be returned on the callback. Any entries where the type is 'put' that have a value of [], '' or Buffer.alloc(0) will be stored as a zero-length character array and therefore be fetched during reads as either '' or Buffer.alloc(0) depending on how they are requested. See levelup for full documentation on how this works in practice.

The optional options argument may contain:

  • sync (boolean, default: false). See db.put() for details about this option.

The callback function will be called with no arguments if the batch is successful or with an Error if the batch failed for any reason.

db.batch() (chained form)

Returns a new chainedBatch instance.

db.approximateSize(start, end, callback)

approximateSize() is an instance method on an existing database object. Used to get the approximate number of bytes of file system space used by the range [start..end). The result may not include recently written data.

The start and end parameters may be strings or Buffers representing keys in the LevelDB store.

The callback function will be called with a single error if the operation failed for any reason. If successful the first argument will be null and the second argument will be the approximate size as a Number.

db.compactRange(start, end, callback)

compactRange() is an instance method on an existing database object. Used to manually trigger a database compaction in the range [start..end).

The start and end parameters may be strings or Buffers representing keys in the LevelDB store.

The callback function will be called with no arguments if the operation is successful or with a single error argument if the operation failed for any reason.

db.getProperty(property)

getProperty can be used to get internal details from LevelDB. When issued with a valid property string, a readable string will be returned (this method is synchronous).

Currently, the only valid properties are:

  • leveldb.num-files-at-levelN: return the number of files at level N, where N is an integer representing a valid level (e.g. "0").

  • leveldb.stats: returns a multi-line string describing statistics about LevelDB's internal operation.

  • leveldb.sstables: returns a multi-line string describing all of the sstables that make up contents of the current database.

db.iterator([options])

Returns a new iterator instance. Accepts the following range options:

  • gt (greater than), gte (greater than or equal) define the lower bound of the range to be iterated. Only entries where the key is greater than (or equal to) this option will be included in the range. When reverse=true the order will be reversed, but the entries iterated will be the same.
  • lt (less than), lte (less than or equal) define the higher bound of the range to be iterated. Only entries where the key is less than (or equal to) this option will be included in the range. When reverse=true the order will be reversed, but the entries iterated will be the same.
  • reverse (boolean, default: false): iterate entries in reverse order. Beware that a reverse seek can be slower than a forward seek.
  • limit (number, default: -1): limit the number of entries collected by this iterator. This number represents a maximum number of entries and may not be reached if you get to the end of the range first. A value of -1 means there is no limit. When reverse=true the entries with the highest keys will be returned instead of the lowest keys.

In addition to range options, iterator() takes the following options:

  • keys (boolean, default: true): whether to return the key of each entry. If set to false, calls to iterator.next(callback) will yield keys with a value of undefined 1. There is a small efficiency gain if you ultimately don't care what the keys are as they don't need to be converted and copied into JavaScript.
  • values (boolean, default: true): whether to return the value of each entry. If set to false, calls to iterator.next(callback) will yield values with a value of undefined1.
  • keyAsBuffer (boolean, default: true): Whether to return the key of each entry as a Buffer or string. Converting from a Buffer to a string incurs a cost so if you need a string (and the key can legitimately become a UTF8 string) then you should fetch it as one.
  • valueAsBuffer (boolean, default: true): Whether to return the value of each entry as a Buffer or string.
  • fillCache (boolean, default: false): whether LevelDB's LRU-cache should be filled with data read.

1 leveldown returns an empty string rather than undefined at the moment.

db.clear([options, ]callback)

Delete all entries or a range. Not guaranteed to be atomic. Accepts the following range options (with the same rules as on iterators):

  • gt (greater than), gte (greater than or equal) define the lower bound of the range to be deleted. Only entries where the key is greater than (or equal to) this option will be included in the range. When reverse=true the order will be reversed, but the entries deleted will be the same.
  • lt (less than), lte (less than or equal) define the higher bound of the range to be deleted. Only entries where the key is less than (or equal to) this option will be included in the range. When reverse=true the order will be reversed, but the entries deleted will be the same.
  • reverse (boolean, default: false): delete entries in reverse order. Only effective in combination with limit, to remove the last N entries.
  • limit (number, default: -1): limit the number of entries to be deleted. This number represents a maximum number of entries and may not be reached if you get to the end of the range first. A value of -1 means there is no limit. When reverse=true the entries with the highest keys will be deleted instead of the lowest keys.

If no options are provided, all entries will be deleted. The callback function will be called with no arguments if the operation was successful or with an Error if it failed for any reason.

chainedBatch

chainedBatch.put(key, value)

Queue a put operation on this batch. This may throw if key or value is invalid, following the same rules as the array form of db.batch().

chainedBatch.del(key)

Queue a del operation on this batch. This may throw if key is invalid.

chainedBatch.clear()

Clear all queued operations on this batch.

chainedBatch.write([options, ]callback)

Commit the queued operations for this batch. All operations will be written atomically, that is, they will either all succeed or fail with no partial commits.

The optional options argument may contain:

  • sync (boolean, default: false). See db.put() for details about this option.

The callback function will be called with no arguments if the batch is successful or with an Error if the batch failed for any reason. After write has been called, no further operations are allowed.

chainedBatch.db

A reference to the db that created this chained batch.

iterator

An iterator allows you to iterate the entire store or a range. It operates on a snapshot of the store, created at the time db.iterator() was called. This means reads on the iterator are unaffected by simultaneous writes.

Iterators can be consumed with for await...of or by manually calling iterator.next() in succession. In the latter mode, iterator.end() must always be called. In contrast, finishing, throwing or breaking from a for await...of loop automatically calls iterator.end().

An iterator reaches its natural end in the following situations:

  • The end of the store has been reached
  • The end of the range has been reached
  • The last iterator.seek() was out of range.

An iterator keeps track of when a next() is in progress and when an end() has been called so it doesn't allow concurrent next() calls, it does allow end() while a next() is in progress and it doesn't allow either next() or end() after end() has been called.

for await...of iterator

Yields arrays containing a key and value. The type of key and value depends on the options passed to db.iterator().

try {
  for await (const [key, value] of db.iterator()) {
    console.log(key)
  }
} catch (err) {
  console.error(err)
}

iterator.next([callback])

Advance the iterator and yield the entry at that key. If an error occurs, the callback function will be called with an Error. Otherwise, the callback receives null, a key and a value. The type of key and value depends on the options passed to db.iterator(). If the iterator has reached its natural end, both key and value will be undefined.

If no callback is provided, a promise is returned for either an array (containing a key and value) or undefined if the iterator reached its natural end.

Note: Always call iterator.end(), even if you received an error and even if the iterator reached its natural end.

iterator.seek(key)

Seek the iterator to a given key or the closest key. Subsequent calls to iterator.next() will yield entries with keys equal to or larger than target, or equal to or smaller than target if the reverse option passed to db.iterator() was true. The same applies to implicit iterator.next() calls in a for await...of loop.

If range options like gt were passed to db.iterator() and target does not fall within that range, the iterator will reach its natural end.

iterator.end([callback])

End iteration and free up underlying resources. The callback function will be called with no arguments on success or with an Error if ending failed for any reason.

If no callback is provided, a promise is returned.

iterator.db

A reference to the db that created this iterator.

leveldown.destroy(location, callback)

Completely remove an existing LevelDB database directory. You can use this function in place of a full directory rm if you want to be sure to only remove LevelDB-related files. If the directory only contains LevelDB files, the directory itself will be removed as well. If there are additional, non-LevelDB files in the directory, those files, and the directory, will be left alone.

The callback will be called when the destroy operation is complete, with a possible error argument.

leveldown.repair(location, callback)

Attempt a restoration of a damaged LevelDB store. From the LevelDB documentation:

If a DB cannot be opened, you may attempt to call this method to resurrect as much of the contents of the database as possible. Some data may be lost, so be careful when calling this function on a database that contains important information.

You will find information on the repair operation in the LOG file inside the store directory.

A repair() can also be used to perform a compaction of the LevelDB log into table files.

The callback will be called when the repair operation is complete, with a possible error argument.

Safety

Database State

Currently leveldown does not track the state of the underlying LevelDB instance. This means that calling open() on an already open database may result in an error. Likewise, calling any other operation on a non-open database may result in an error.

levelup currently tracks and manages state and will prevent out-of-state operations from being send to leveldown. If you use leveldown directly then you must track and manage state for yourself.

Snapshots

leveldown exposes a feature of LevelDB called snapshots. This means that when you do e.g. createReadStream and createWriteStream at the same time, any data modified by the write stream will not affect data emitted from the read stream. In other words, a LevelDB Snapshot captures the latest state at the time the snapshot was created, enabling the snapshot to iterate or read the data without seeing any subsequent writes. Any read not performed on a snapshot will implicitly use the latest state.

Getting Support

You're welcome to open an issue on the GitHub repository if you have a question.

Past and no longer active support channels include the ##leveldb IRC channel on Freenode and the Node.js LevelDB Google Group.

Contributing

Level/leveldown is an OPEN Open Source Project. This means that:

Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.

See the Contribution Guide for more details.

Git Submodules

This project uses Git Submodules. This means that you should clone it recursively if you're planning on working on it:

$ git clone --recurse-submodules https://github.com/Level/leveldown.git

Alternatively, you can initialize submodules inside the cloned folder:

$ git submodule update --init --recursive

Publishing

  1. Increment the version: npm version ..
  2. Push to GitHub: git push --follow-tags
  3. Wait for CI to complete
  4. Download prebuilds into ./prebuilds: npm run download-prebuilds
  5. Optionally verify loading a prebuild: npm run test-prebuild
  6. Optionally verify which files npm will include: canadian-pub
  7. Finally: npm publish

Support us with a monthly donation on Open Collective and help us continue our work.

License

MIT

leveldown builds on the excellent work of the LevelDB and Snappy teams from Google and additional contributors. LevelDB and Snappy are both issued under the New BSD License. A large portion of leveldown Windows support comes from the Windows LevelDB port (archived) by Krzysztof Kowalczyk (@kjk). If you're using leveldown on Windows, you should give him your thanks!

changelog

Changelog

6.1.1 - 2022-03-25

Fixed

  • Fix getMany() memory leak (#804) (51979d1) (Vincent Weevers)
  • Document new features (ba729d2) (Vincent Weevers).

6.1.0 - 2021-09-28

Added

  • Add db.getMany(keys) (#787) (50dc50b) (Vincent Weevers).

6.0.3 - 2021-09-28

Fixed

  • Build universal binary for M1 (Apple silicon) (#781) (26ea717) (Vincent Weevers)
  • Make db.clear() 27x faster by doing it natively (aedf49e) (Vincent Weevers)
  • Optimize db.iterator() (112906b) (Vincent Weevers)
  • Cleanup hanging iterator also when next() errored (7356ba4) (Vincent Weevers)
  • Prevent GC of db during clear() and other operations (9a3f59a) (Vincent Weevers).

6.0.2 - 2021-09-12

Fixed

  • Close database on environment exit (#783) (8fdcaaa) (Vincent Weevers).

6.0.1 - 2021-08-01

Fixed

  • Support approximateSize() on db bigger than 4 GB (#777) (8740057) (Lars Kuhtz)

6.0.0 - 2021-04-10

If you are upgrading: please see UPGRADING.md.

Changed

  • Breaking: bump abstract-leveldown (15d5a9e) (Vincent Weevers)
  • Breaking: drop node 8 (Level/community#98) (8502b34) (Vincent Weevers)
  • Bump node-gyp from 6.x to 7.x (8bc5696) (Vincent Weevers)
  • Bump standard from 14.x to 16.x (d39e232, 39e3ca3) (Vincent Weevers)
  • Bump node-gyp-build from 4.1.x to 4.2.x (#708) (91711fa) (Vincent Weevers)
  • Skip stack exhaustion test (55a33b1) (Vincent Weevers)

Removed

5.6.0 - 2020-03-27

Changed

  • Upgrade nyc devDependency from ^14.0.0 to ^15.0.0 (#696) (@vweevers)
  • Upgrade electron devDependency from ^7.0.1 to ^8.0.0 (#700) (@vweevers)

Added

5.5.1 - 2020-02-24

Fixed

  • Fix android arm64 prebuild by disabling exceptions (#706) (@vweevers)

5.5.0 - 2020-02-19

Changed

Added

5.4.1 - 2019-10-26

Fixed

5.4.0 - 2019-10-19

Changed

  • Refactor initialization of range options (#681) (@vweevers)
  • Make iterator seek target a local variable (#683) (@vweevers)
  • Upgrade node-gyp devDependency from ^5.0.0 to ^6.0.0 (#677) (@vweevers)
  • Upgrade dependency-check devDependency from ^3.3.0 to ^4.1.0 (8965e58) (@vweevers)

Added

5.3.0 - 2019-10-04

Changed

  • Replace Ubuntu 16.04 with CentOS 7 for prebuilds (#674) (@rvagg). This makes the prebuilt binary for linux compatible with Debian 8, Ubuntu 14.04, RHEL 7, CentOS 7 and other flavors with an old glibc.

Added

5.3.0-0 - 2019-10-04

This was a prerelease of 5.3.0 for testing purposes. Changes listed above.

5.2.1 - 2019-09-20

Added

Fixed

5.2.0 - 2019-09-06

Changed

  • Upgrade abstract-leveldown from ~6.0.3 to ~6.1.1 (#660) (@vweevers)
  • Upgrade napi-macros from ~1.8.1 to ~2.0.0 (#657) (@vweevers)
  • Upgrade hallmark devDependency from ^0.1.0 to ^2.0.0 (#654, #663) (@vweevers)
  • Upgrade standard devDependency from ^12.0.0 to ^14.0.0 (#653, #661) (@vweevers)
  • Upgrade rimraf devDependency from ^2.6.1 to ^3.0.0 (#658) (@vweevers)
  • Upgrade electron devDependency from ^5.0.0 to ^6.0.0 (#656) (@vweevers)

Added

5.1.1 - 2019-06-28

Changed

  • Remove fast-future in favor of native cache limit (#638) (@vweevers)
  • Upgrade delayed devDependency from ^1.0.1 to ^2.0.0 (#650) (@vweevers)
  • Upgrade readfiletree devDependency from ~0.0.1 to ^1.0.0 (#648) (@vweevers)
  • Upgrade du devDependency from ~0.1.0 to ^1.0.0 (#649) (@vweevers)
  • Upgrade mkfiletree devDependency from ^1.0.1 to ^2.0.0 (#647) (@vweevers)
  • Upgrade node-gyp devDependency from ^4.0.0 to ^5.0.0 (#642) (@vweevers)
  • Replace async devDependency with async-each (#637) (@vweevers)

Removed

Fixed

  • Fix batch compression test to actually compress (#651) (@vweevers)

5.1.0 - 2019-05-18

Changed

  • Upgrade node-gyp-build from ~3.8.0 to ~4.1.0 (#625) (@vweevers)
  • Upgrade prebuildify devDependency from prebuild/prebuildify#override-platform to ^3.0.0 (#625) (@vweevers)
  • Upgrade electron devDependency from ^4.1.2 to ^5.0.0 (#616) (@vweevers)
  • CI optimization: skip initial compilation in Travis arm job (#625) (@vweevers)
  • CI optimization: skip redundant npm install in arm containers (#625) (@vweevers)

Added

Fixed

  • Add armv tag to ARM prebuilds (to ensure ARM version matches) (#625) (@vweevers)

5.0.3 - 2019-04-26

Changed

Added

Fixed

  • Prevent segfault: create reference to chained batch object (#621) (@vweevers)
  • Skip writing empty (chained) batch and make callbacks asynchronous (#619) (@vweevers)
  • Throw error in iterator_seek if iterator has ended (#618) (@vweevers)

5.0.2 - 2019-04-23

Changed

  • Upgrade nyc devDependency from ^13.2.0 to ^14.0.0 (#610) (@vweevers)
  • Upgrade tempy devDependency from ^0.2.1 to ^0.3.0 (#611) (@vweevers)

Fixed

5.0.1 - 2019-04-07

Added

Removed

Fixed

  • Skip hallmark test because it broke (and is out of scope for) CITGM (#606) (@vweevers)

5.0.0 - 2019-03-29

If you are upgrading: please see UPGRADING.md.

Changed

Added

Removed

Fixed

  • Serialize compactRange() arguments (#517) (@vweevers)
  • Prevent segfault: when calling iterator() on non-open db (#514) (@vweevers)
  • Prevent segfault: add PriorityWorker to defer closing until put is done (#597) (@vweevers)
  • Prevent segfault: keep persistent references to iterators until they are ended (#597) (@vweevers)
  • Gitignore Debug builds of LevelDB and Snappy (#597) (@vweevers)
  • Fix subtests by adding t.plan() (#594) (@vweevers)

4.0.2 - 2019-03-02

Changed

Added

4.0.1 - 2018-05-22

Changed

Removed

4.0.0 - 2018-05-16

Added

Changed

Fixed

Removed

3.0.2 - 2018-05-05

Changed

3.0.1 - 2018-04-26

Added

  • Run verify-travis-appveyor as part of tests to ensure they are in sync (@ralphtheninja)
  • Test that destroy() doesn't inadvertently create the directory (@vweevers)
  • Add node 10 to Travis and AppVeyor (@ralphtheninja)

Changed

Fixed

  • Handle all errors in destroy tests (@vweevers)
  • Fix deprecation warnings related to Buffer() (@peakji)
  • Fix deprecation warnings related to nan (@ralphtheninja)

Removed

  • Remove node 5 and 7 from AppVeyor (@ralphtheninja)
  • Remove console.log() from approximate-size-test.js (@vweevers)

3.0.0 - 2018-01-30

Changed

Removed

Fixed

  • Make sure destroy() deletes LevelDB-only dir (@joyeecheung)

2.1.1 - 2017-12-02

Fixed

  • Omit docs from LevelDB and test files from Snappy (@peakji)

2.1.0 - 2017-11-24

Fixed

  • Fix Android compilation (@staltz)

2.0.2 - 2017-11-23

Added

Changed

2.0.1 - 2017-11-11

Changed

Fixed

2.0.0 - 2017-10-02

Changed

Removed

1.9.0 - 2017-09-28

Added

  • Add default export of LevelDOWN (@zixia)

1.8.0 - 2017-09-14

Added

Changed

1.7.2 - 2017-06-08

Changed

  • iterator.next() calls back with error if called after iterator.end() (@peakji)

Fixed

  • Closing db with open iterator should not crash (@peakji)

1.7.1 - 2017-06-01

Added

Changed

1.7.0 - 2017-05-17

Changed

1.7.0-0 - 2017-04-12

Added

  • Add support for OpenBSD (@qbit)

Changed

1.6.0 - 2017-02-02

Added

Changed

1.5.3 - 2016-12-30

Added

1.5.2 - 2016-12-29

Added

1.5.1 - 2016-12-27

Added

Changed

  • Enable iterator.seek() with buffers (@peakji)

Removed

1.5.0 - 2016-09-27

Changed

Removed

1.4.6 - 2016-04-29

Added

Changed

1.4.5 - 2016-04-18

Added

Changed

Removed

Fixed

  • Fix delete calls not using [] (@chjj)
  • Free start slices on conflicting options (@chjj)
  • Dispose of unused slices (@chjj)
  • Release iterator snapshots (@chjj)
  • Fix iterator leak (@chjj)
  • Add handlescopes to fix potential memory leaks (@chjj)
  • Fix repair-test for multilang windows (@vweevers)
  • Repair error is different on windows (@ralphtheninja)

1.4.4 - 2016-01-25

Changed

Fixed

1.4.3 - 2015-12-14

Added

Changed

Fixed

1.4.2 - 2015-10-21

Added

Changed

1.4.1 - 2015-08-15

Added

Changed

1.4.0 - 2015-07-28

Added

Changed

Removed

1.3.1-0 - 2015-07-20

Changed

Removed

1.3.0 - 2015-06-16

Added

Changed

Removed

Fixed

  • Add LEVELDB_PLATFORM_UV to LevelDB port.h to fix test (Braydon Fuller)

1.2.2 - 2015-06-02

Fixed

  • Ignore build-pre-gyp/ folder when publishing to npm (@ralphtheninja)

1.2.1 - 2015-06-01

Changed

  • Use remote_path with node-pre-gyp to dodge preparing package.json every time (@ralphtheninja)
  • Add more io.js versions (@ralphtheninja)
  • Use node-gyp-install to make sure correct node-gyp headers are downloaded (@ralphtheninja)

1.2.0 - 2015-06-01

Added

1.1.0 - 2015-05-28

Changed

1.0.7 - 2015-05-27

Added

Changed

1.0.6 - 2015-05-05

Changed

1.0.5 - 2015-05-05

Fixed

1.0.4 - 2015-05-05

Changed

1.0.3 - 2015-05-02

Changed

Fixed

1.0.2 - 2015-04-26

Added

  • Add documentation about snapshots (@maxogden)

Changed

1.0.1 - 2015-01-16

Changed

Fixed

  • Fix LevelDB builds for modern gcc versions (@sharvil)

1.0.0 - 2014-08-26

Changed

Removed

  • Remove compile option that borked EL5 compiles (@rvagg)

Fixed

  • Fix clang build (@thlorenz)
  • Fix minor memory leaks in options attributes (@ggreer)

0.10.6 - 2016-01-07

Added

Changed

Removed

0.10.5 - 2015-05-05

Changed

0.10.4 - 2015-02-07

Changed

0.10.3 - 2015-02-07

Changed

0.10.2 - 2013-11-30

Fixed

0.10.1 - 2013-11-21

From this release and onward, tags in git start with the prefix v, i.e. this release corresponds to the tag v0.10.1.

Changed

  • Upgrade to `nan@0.6for Node 0.11.6 support,v8::Local<T>::New(val)rewritten toNanNewLocal<T>(val)` (@rvagg)

0.10.0 - 2013-11-18

Added

  • Add new simple batch() leak tester (@rvagg)

Changed

Removed

  • Remove Persistent references for all batch() operations as WriteBatch takes an explicit copy of the data (@mcollina and @rvagg)

Fixed

0.9.2 - 2013-11-02

Fixed

0.9.1 - 2013-10-03

Fixed

  • Include port_uv.h for Windows compile, added test to suite to make sure this happens every time LevelDB is upgraded (@rvagg)

0.9.0 - 2013-10-01

Changed

0.8.3 - 2013-09-18

The diff between this version and the previous shows 0.8.4 in the commit message. This is incorrect, since that version was never released.

Changed

  • Upgrade to `nan@0.4.0`, better support for latest Node master & support for installing within directory structures containing spaces in directory names (@rvagg)

0.8.2 - 2013-09-01

Added

0.8.1 - 2013-09-01

Added

Fixed

  • Fix minor V8-level leaks (@rvagg)

0.8.0 - 2013-08-26

Added

Changed

  • Switch to nan as an npm dependency (@rvagg)

0.7.0 - 2013-08-11

Added

Changed

  • Use nan for Node 0.8->0.11 compatibility (@rvagg)
  • Minor perf improvements in C++ (@mscdex)

0.6.2 - 2013-07-07

Changed

  • Compatibility for `Node@0.11.3`, breaks compatibility with 0.11.2

0.6.1 - 2013-06-15

Fixed

  • Fix broken Windows compile, apply port-uv patch to LevelDB's port.h (@rvagg)

0.6.0 - 2013-06-14

Changed

0.5.0 - 2013-05-21

Changed

  • Bump major version for db.getProperty() addition (should have been done in 0.4.4) (@rvagg)
  • Disallow batch() operations after a write() (@rvagg)

0.4.4 - 2013-05-18

Added

  • Add db.getProperty(), see README for details (@rvagg)

Fixed

  • More work on memory management, including late-creation of Persistent handles (@rvagg)

0.4.3 - 2013-05-18

Fixed

  • Better memory leak fix (@rvagg)

0.4.2 - 2013-05-17

Fixed

  • Same memory leak fixes as 0.4.1, properly applied to batch() operations too (@rvagg)

0.4.1 - 2013-05-17

Fixed

  • Fix memory leak caused when passing String objects in as keys and values, conversion to Slice created new char[] but wasn't being disposed. Buffers are automatically disposed (reported by @kylegetson levelup/#140) (@rvagg)

0.4.0 - 2013-05-15

Changed

0.3.1 - 2013-05-14

Fixed

  • Don't allow empty batch() operations through to LevelDB, on chained of array forms (@rvagg)

0.3.0 - 2013-05-14

In the early days minor versions were looked upon as major versions. Semver practices we use today was not adopted fully at this time. This is why the history might look a bit confusing.

Added

Changed

  • Pull API tests up into AbstractLevelDOWN, require it to run the tests. AbstractLevelDOWN can now be used to test LevelDOWN-compliant API's (@maxogden)
  • Change iterator methods to return errors on the callbacks rather than throw (@mcollina & @rvagg)
  • Update documentation for .get() (@deanlandolt)

Removed

  • Remove browserify shim (@rvagg)

0.2.3 - 2013-05-17

Fixed

  • Backport memory leak fixes (@rvagg)

0.2.2 - 2013-05-14

Added

  • Add node 0.10 to Travis (@rvagg)
  • Add @mcollina to contributors (@rvagg)
  • Add browserify shim so levelup can run in the browser (@No9)

Changed

  • Extract basic test code to abstract-leveldown (@maxogden)

0.2.1 - 2013-04-08

Changed

  • Ignore empty string/buffer start/end options on iterators (@kesla)
  • Macro cleanup, replace some with static inline functions (@rvagg)

Fixed

  • Fix iterator to start on correct value when reverse=true, also handle end-of-store case (#27) (@kesla)

0.2.0 - 2013-03-30

Added

  • Add windows support, using a combination of libuv and Windows-specific code. See README for details about what's required (@rvagg)
  • Add leveldown.destroy(location, cb) to delete an existing LevelDB store, exposes LevelDB.DestroyDB() (@rvagg)
  • Add leveldown.repair(location, cb) to repair an existing LevelDB store, exposes LevelDB.RepairDB() (@rvagg)
  • Add advanced options: writeBufferSize, blockSize, maxOpenFiles, blockRestartInterval, exposes LevelDB options (@rvagg)
  • Add chained batch operations. Argument-less db.batch() will return a new Batch object that can .put() and .del() and then .write(). API in flux so not documented yet. (@juliangruber / @rvagg)

Changed

  • Auto-cleanup iterators that are left open when you close a database; any iterators left open when you close a database instance will kill your process so we now keep track of iterators and auto-close them before a db.close completes (@rvagg)

0.1.4 - 2013-03-11

Changed

0.1.3 - 2013-03-09

Fixed

0.1.2 - 2013-02-24

Changed

0.1.1 - 2013-02-24

Fixed

0.1.0 - 2013-02-24

Added

  • Add complete, independent test suite (@rvagg)

Changed

  • Change API to export single function levelup() (@rvagg)
  • Move createIterator() to levelup#iterator() (@rvagg)
  • Make all options arguments optional (@rvagg)
  • Argument number & type checking on all methods (@rvagg)
  • Stricter checking on key & value types, String/Object.toString()/Buffer, non-zero-length (@rvagg)

Removed

  • Remove use namespace and add namespace leveldown everywhere (@rvagg)

Fixed

0.0.2 - 2013-01-20

Changed

  • Finalize rename of internal components to LevelDOWN, removing LevelUP references (@rvagg)

0.0.1 - 2013-01-20

Added

  • Complete documentation of current API (@rvagg)

Fixed

  • Callback is not optional for .close() (@rvagg)

0.0.0 - 2013-01-06

:seedling: First release. Extracted from levelup as a stand-alone package (@rvagg)