Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

encoding-down

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

encoding-down - npm Package Compare versions

Comparing version 7.0.0 to 7.1.0

LICENSE

98

CHANGELOG.md
# Changelog
## [7.1.0] - 2021-09-30
### Added
- Add `db.getMany(keys)` ([#102](https://github.com/Level/encoding-down/issues/102)) ([`4038a30`](https://github.com/Level/encoding-down/commit/4038a30)) (Vincent Weevers).
## [7.0.0] - 2021-04-09
_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._
### Changed

@@ -73,2 +81,4 @@

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._
### Changed

@@ -124,2 +134,4 @@

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._
### Added

@@ -146,2 +158,4 @@

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._
### Added

@@ -172,2 +186,4 @@

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._
### Added

@@ -339,80 +355,84 @@

## 1.0.0 - 2017-01-26
## [1.0.0] - 2017-01-26
:seedling: Initial release.
[7.0.0]: https://github.com/Level/encoding-down/compare/v6.3.0...v7.0.0
[7.1.0]: https://github.com/Level/encoding-down/releases/tag/v7.1.0
[6.3.0]: https://github.com/Level/encoding-down/compare/v6.2.0...v6.3.0
[7.0.0]: https://github.com/Level/encoding-down/releases/tag/v7.0.0
[6.2.0]: https://github.com/Level/encoding-down/compare/v6.1.0...v6.2.0
[6.3.0]: https://github.com/Level/encoding-down/releases/tag/v6.3.0
[6.1.0]: https://github.com/Level/encoding-down/compare/v6.0.2...v6.1.0
[6.2.0]: https://github.com/Level/encoding-down/releases/tag/v6.2.0
[6.0.2]: https://github.com/Level/encoding-down/compare/v6.0.1...v6.0.2
[6.1.0]: https://github.com/Level/encoding-down/releases/tag/v6.1.0
[6.0.1]: https://github.com/Level/encoding-down/compare/v6.0.0...v6.0.1
[6.0.2]: https://github.com/Level/encoding-down/releases/tag/v6.0.2
[6.0.0]: https://github.com/Level/encoding-down/compare/v5.0.4...v6.0.0
[6.0.1]: https://github.com/Level/encoding-down/releases/tag/v6.0.1
[5.0.4]: https://github.com/Level/encoding-down/compare/v5.0.3...v5.0.4
[6.0.0]: https://github.com/Level/encoding-down/releases/tag/v6.0.0
[5.0.3]: https://github.com/Level/encoding-down/compare/v5.0.2...v5.0.3
[5.0.4]: https://github.com/Level/encoding-down/releases/tag/v5.0.4
[5.0.2]: https://github.com/Level/encoding-down/compare/v5.0.1...v5.0.2
[5.0.3]: https://github.com/Level/encoding-down/releases/tag/v5.0.3
[5.0.1]: https://github.com/Level/encoding-down/compare/v5.0.0...v5.0.1
[5.0.2]: https://github.com/Level/encoding-down/releases/tag/v5.0.2
[5.0.0]: https://github.com/Level/encoding-down/compare/v4.0.1...v5.0.0
[5.0.1]: https://github.com/Level/encoding-down/releases/tag/v5.0.1
[4.0.1]: https://github.com/Level/encoding-down/compare/v4.0.0...v4.0.1
[5.0.0]: https://github.com/Level/encoding-down/releases/tag/v5.0.0
[4.0.0]: https://github.com/Level/encoding-down/compare/v3.0.1...v4.0.0
[4.0.1]: https://github.com/Level/encoding-down/releases/tag/v4.0.1
[3.0.1]: https://github.com/Level/encoding-down/compare/v3.0.0...v3.0.1
[4.0.0]: https://github.com/Level/encoding-down/releases/tag/v4.0.0
[3.0.0]: https://github.com/Level/encoding-down/compare/v2.3.4...v3.0.0
[3.0.1]: https://github.com/Level/encoding-down/releases/tag/v3.0.1
[2.3.4]: https://github.com/Level/encoding-down/compare/v2.3.3...v2.3.4
[3.0.0]: https://github.com/Level/encoding-down/releases/tag/v3.0.0
[2.3.3]: https://github.com/Level/encoding-down/compare/v2.3.2...v2.3.3
[2.3.4]: https://github.com/Level/encoding-down/releases/tag/v2.3.4
[2.3.2]: https://github.com/Level/encoding-down/compare/v2.3.1...v2.3.2
[2.3.3]: https://github.com/Level/encoding-down/releases/tag/v2.3.3
[2.3.1]: https://github.com/Level/encoding-down/compare/v2.3.0...v2.3.1
[2.3.2]: https://github.com/Level/encoding-down/releases/tag/v2.3.2
[2.3.0]: https://github.com/Level/encoding-down/compare/v2.2.1...v2.3.0
[2.3.1]: https://github.com/Level/encoding-down/releases/tag/v2.3.1
[2.2.1]: https://github.com/Level/encoding-down/compare/v2.2.0...v2.2.1
[2.3.0]: https://github.com/Level/encoding-down/releases/tag/v2.3.0
[2.2.0]: https://github.com/Level/encoding-down/compare/v2.1.5...v2.2.0
[2.2.1]: https://github.com/Level/encoding-down/releases/tag/v2.2.1
[2.1.5]: https://github.com/Level/encoding-down/compare/v2.1.4...v2.1.5
[2.2.0]: https://github.com/Level/encoding-down/releases/tag/v2.2.0
[2.1.4]: https://github.com/Level/encoding-down/compare/v2.1.3...v2.1.4
[2.1.5]: https://github.com/Level/encoding-down/releases/tag/v2.1.5
[2.1.3]: https://github.com/Level/encoding-down/compare/v2.1.2...v2.1.3
[2.1.4]: https://github.com/Level/encoding-down/releases/tag/v2.1.4
[2.1.2]: https://github.com/Level/encoding-down/compare/v2.1.1...v2.1.2
[2.1.3]: https://github.com/Level/encoding-down/releases/tag/v2.1.3
[2.1.1]: https://github.com/Level/encoding-down/compare/v2.1.0...v2.1.1
[2.1.2]: https://github.com/Level/encoding-down/releases/tag/v2.1.2
[2.1.0]: https://github.com/Level/encoding-down/compare/v2.0.8...v2.1.0
[2.1.1]: https://github.com/Level/encoding-down/releases/tag/v2.1.1
[2.0.8]: https://github.com/Level/encoding-down/compare/v2.0.7...v2.0.8
[2.1.0]: https://github.com/Level/encoding-down/releases/tag/v2.1.0
[2.0.7]: https://github.com/Level/encoding-down/compare/v2.0.6...v2.0.7
[2.0.8]: https://github.com/Level/encoding-down/releases/tag/v2.0.8
[2.0.6]: https://github.com/Level/encoding-down/compare/v2.0.5...v2.0.6
[2.0.7]: https://github.com/Level/encoding-down/releases/tag/v2.0.7
[2.0.5]: https://github.com/Level/encoding-down/compare/v2.0.4...v2.0.5
[2.0.6]: https://github.com/Level/encoding-down/releases/tag/v2.0.6
[2.0.4]: https://github.com/Level/encoding-down/compare/v2.0.3...v2.0.4
[2.0.5]: https://github.com/Level/encoding-down/releases/tag/v2.0.5
[2.0.3]: https://github.com/Level/encoding-down/compare/v2.0.2...v2.0.3
[2.0.4]: https://github.com/Level/encoding-down/releases/tag/v2.0.4
[2.0.2]: https://github.com/Level/encoding-down/compare/v2.0.1...v2.0.2
[2.0.3]: https://github.com/Level/encoding-down/releases/tag/v2.0.3
[2.0.1]: https://github.com/Level/encoding-down/compare/v2.0.0...v2.0.1
[2.0.2]: https://github.com/Level/encoding-down/releases/tag/v2.0.2
[2.0.0]: https://github.com/Level/encoding-down/compare/v1.0.0...v2.0.0
[2.0.1]: https://github.com/Level/encoding-down/releases/tag/v2.0.1
[2.0.0]: https://github.com/Level/encoding-down/releases/tag/v2.0.0
[1.0.0]: https://github.com/Level/encoding-down/releases/tag/v1.0.0

@@ -87,2 +87,28 @@ 'use strict'

DB.prototype._getMany = function (keys, opts, cb) {
keys = keys.map((key) => this.codec.encodeKey(key, opts))
opts.asBuffer = this.codec.valueAsBuffer(opts)
this.db.getMany(keys, opts, (err, values) => {
if (err) return cb(err)
const decoded = new Array(values.length)
for (let i = 0; i < values.length; i++) {
if (values[i] === undefined) {
decoded[i] = undefined
continue
}
try {
decoded[i] = this.codec.decodeValue(values[i], opts)
} catch (err) {
return cb(new EncodingError(err))
}
}
cb(null, decoded)
})
}
DB.prototype._del = function (key, opts, cb) {

@@ -89,0 +115,0 @@ key = this.codec.encodeKey(key, opts)

{
"name": "encoding-down",
"version": "7.0.0",
"version": "7.1.0",
"description": "An abstract-leveldown implementation that wraps another store to encode keys and values",

@@ -10,3 +10,3 @@ "license": "MIT",

"test-browsers-local": "airtap --coverage test/index.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"coverage": "nyc report -r lcovonly",
"hallmark": "hallmark --fix",

@@ -19,8 +19,6 @@ "dependency-check": "dependency-check . test/*.js",

"CHANGELOG.md",
"CONTRIBUTORS.md",
"LICENSE.md",
"UPGRADING.md"
],
"dependencies": {
"abstract-leveldown": "^7.0.0",
"abstract-leveldown": "^7.2.0",
"inherits": "^2.0.3",

@@ -33,7 +31,5 @@ "level-codec": "^10.0.0",

"airtap-playwright": "^1.0.1",
"coveralls": "^3.0.2",
"dependency-check": "^3.3.0",
"hallmark": "^3.1.0",
"level-community": "^3.0.0",
"memdown": "^5.0.0",
"memdown": "^6.1.0",
"nyc": "^15.1.0",

@@ -43,5 +39,2 @@ "standard": "^16.0.3",

},
"hallmark": {
"community": "level-community"
},
"repository": "Level/encoding-down",

@@ -48,0 +41,0 @@ "homepage": "https://github.com/Level/encoding-down",

@@ -6,10 +6,9 @@ # encoding-down

[![level badge][level-badge]](https://github.com/Level/awesome)
[![npm](https://img.shields.io/npm/v/encoding-down.svg?label=&logo=npm)](https://www.npmjs.com/package/encoding-down)
[![npm](https://img.shields.io/npm/v/encoding-down.svg)](https://www.npmjs.com/package/encoding-down)
[![Node version](https://img.shields.io/node/v/encoding-down.svg)](https://www.npmjs.com/package/encoding-down)
[![Travis](https://img.shields.io/travis/Level/com/encoding-down.svg?logo=travis&label=)](https://travis-ci.com/Level/encoding-down)
[![Coverage Status](https://coveralls.io/repos/github/Level/encoding-down/badge.svg)](https://coveralls.io/github/Level/encoding-down)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![npm](https://img.shields.io/npm/dm/encoding-down.svg?label=dl)](https://www.npmjs.com/package/encoding-down)
[![Backers on Open Collective](https://opencollective.com/level/backers/badge.svg?color=orange)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/level/sponsors/badge.svg?color=orange)](#sponsors)
[![Test](https://img.shields.io/github/workflow/status/Level/encoding-down/Test?label=test)](https://github.com/Level/encoding-down/actions/workflows/test.yml)
[![Coverage](https://img.shields.io/codecov/c/github/Level/encoding-down?label=&logo=codecov&logoColor=fff)](https://codecov.io/gh/Level/encoding-down)
[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript&logoColor=fff)](https://standardjs.com)
[![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org)
[![Donate](https://img.shields.io/badge/donate-orange?logo=open-collective&logoColor=fff)](https://opencollective.com/level)

@@ -27,7 +26,7 @@ ## Introduction

```js
var levelup = require('levelup')
var leveldown = require('leveldown')
var encode = require('encoding-down')
const levelup = require('levelup')
const leveldown = require('leveldown')
const encode = require('encoding-down')
var db = levelup(encode(leveldown('./db1')))
const db = levelup(encode(leveldown('./db1')))

@@ -44,3 +43,3 @@ db.put('example', Buffer.from('encoding-down'), function (err) {

```js
var db = levelup(encode(leveldown('./db2'), { valueEncoding: 'json' }))
const db = levelup(encode(leveldown('./db2'), { valueEncoding: 'json' }))

@@ -58,3 +57,3 @@ db.put('example', { awesome: true }, function (err) {

```js
var db = levelup(encode(leveldown('./db3'), { valueEncoding: 'hex' }))
const db = levelup(encode(leveldown('./db3'), { valueEncoding: 'hex' }))

@@ -71,3 +70,3 @@ db.put('example', Buffer.from([0, 255]), function (err) {

```js
var db = levelup(encode(leveldown('./db4'), { valueEncoding: 'binary' }))
const db = levelup(encode(leveldown('./db4'), { valueEncoding: 'binary' }))

@@ -89,3 +88,3 @@ db.put('example', Buffer.from([0, 255]), function (err) {

```js
var db = levelup(encode(leveldown('./db5'), { keyEncoding: 'json' }))
const db = levelup(encode(leveldown('./db5'), { keyEncoding: 'json' }))

@@ -100,3 +99,3 @@ db.put({ awesome: true }, 'example', function (err) {

```js
var db = levelup(encode(leveldown('./db6'), { keyEncoding: 'binary' }))
const db = levelup(encode(leveldown('./db6'), { keyEncoding: 'binary' }))

@@ -115,4 +114,4 @@ db.put(Buffer.from([0, 255]), 'example', function (err) {

```js
var level = require('level')
var db = level('./db7', { valueEncoding: 'json' })
const level = require('level')
const db = level('./db7', { valueEncoding: 'json' })

@@ -143,7 +142,7 @@ db.put('example', 42, function (err) {

```js
var level = require('level')
var lexint = require('lexicographic-integer')
const level = require('level')
const lexint = require('lexicographic-integer')
async function main () {
var db = level('./db8', {
const db = level('./db8', {
keyEncoding: {

@@ -170,6 +169,6 @@ type: 'lexicographic-integer',

```js
var level = require('level')
var lexint = require('lexicographic-integer-encoding')('hex')
const level = require('level')
const lexint = require('lexicographic-integer-encoding')('hex')
var db = level('./db8', {
const db = level('./db8', {
keyEncoding: lexint

@@ -189,15 +188,7 @@ })

To sustain [`Level`](https://github.com/Level) and its activities, become a backer or sponsor on [Open Collective](https://opencollective.com/level). Your logo or avatar will be displayed on our 28+ [GitHub repositories](https://github.com/Level) and [npm](https://www.npmjs.com/) packages. 💖
Support us with a monthly donation on [Open Collective](https://opencollective.com/level) and help us continue our work.
### Backers
[![Open Collective backers](https://opencollective.com/level/backers.svg?width=890)](https://opencollective.com/level)
### Sponsors
[![Open Collective sponsors](https://opencollective.com/level/sponsors.svg?width=890)](https://opencollective.com/level)
## License
[MIT](LICENSE.md) © 2012-present [Contributors](CONTRIBUTORS.md).
[MIT](LICENSE)

@@ -204,0 +195,0 @@ [level-badge]: https://leveljs.org/img/badge.svg

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc