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

level-packager

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

level-packager - npm Package Compare versions

Comparing version 5.1.1 to 6.0.0

12

abstract/base-test.js
'use strict'
var location = require('./location')
const location = require('./location')

@@ -27,3 +27,3 @@ module.exports = function (test, level) {

test('test db open and use, db=level(location)', function (t) {
var db = level(location)
const db = level(location)
db.put('test3', 'success', function (err) {

@@ -36,5 +36,5 @@ t.notOk(err, 'no error')

test('options.keyEncoding and options.valueEncoding are passed on to encoding-down', function (t) {
var db = level(location, { keyEncoding: 'json', valueEncoding: 'json' })
const db = level(location, { keyEncoding: 'json', valueEncoding: 'json' })
db.on('ready', function () {
var codec = db.db.codec
const codec = db.db.codec
t.equal(codec.opts.keyEncoding, 'json', 'keyEncoding correct')

@@ -47,5 +47,5 @@ t.equal(codec.opts.valueEncoding, 'json', 'valueEncoding correct')

test('encoding options default to utf8', function (t) {
var db = level(location)
const db = level(location)
db.on('ready', function () {
var codec = db.db.codec
const codec = db.db.codec
t.equal(codec.opts.keyEncoding, 'utf8', 'keyEncoding correct')

@@ -52,0 +52,0 @@ t.equal(codec.opts.valueEncoding, 'utf8', 'valueEncoding correct')

'use strict'
var location = require('./location')
const location = require('./location')
module.exports = function (test, level, nonPersistent) {
test('test db values', function (t) {
var c = 0
var db = level(location)
var setup = nonPersistent ? function (callback) {
db.batch([
{ type: 'put', key: 'test1', value: 'success' },
{ type: 'put', key: 'test2', value: 'success' },
{ type: 'put', key: 'test3', value: 'success' }
], callback)
} : function (callback) { callback() }
let c = 0
const db = level(location)
const setup = nonPersistent
? function (callback) {
db.batch([
{ type: 'put', key: 'test1', value: 'success' },
{ type: 'put', key: 'test2', value: 'success' },
{ type: 'put', key: 'test3', value: 'success' }
], callback)
}
: function (callback) { callback() }

@@ -17,0 +19,0 @@ function read (err, value) {

'use strict'
var fs = require('fs')
var path = require('path')
var location = require('./location')
const fs = require('fs')
const path = require('path')
const location = require('./location')

@@ -7,0 +7,0 @@ module.exports = function (test, level) {

'use strict'
var location = require('./location')
const location = require('./location')

@@ -5,0 +5,0 @@ module.exports = function (test, level) {

@@ -1,3 +0,6 @@

var path = require('path')
'use strict'
module.exports = path.join(__dirname, 'level-test-' + process.pid + '.db')
const path = require('path')
const os = require('os')
module.exports = path.join(os.tmpdir(), 'level-packager-' + process.pid + '-' + Date.now())
'use strict'
var location = require('./location')
const location = require('./location')

@@ -5,0 +5,0 @@ module.exports = function (test, level) {

# Changelog
_**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md)._
## [6.0.0] - 2021-04-17
### Changed
- **Breaking:** modernize syntax and bump `standard` ([Level/community#98](https://github.com/Level/community/issues/98)) ([`4770d17`](https://github.com/Level/packager/commit/4770d17)) (Vincent Weevers)
- **Breaking:** bump `levelup` and `encoding-down` ([`c92e054`](https://github.com/Level/packager/commit/c92e054)) (Vincent Weevers)
- Add `files` to `package.json` ([`809fb8e`](https://github.com/Level/packager/commit/809fb8e)) (Vincent Weevers)
### Removed
- **Breaking:** drop node 6 and 8 ([Level/community#98](https://github.com/Level/community/issues/98)) ([`5fd4a37`](https://github.com/Level/packager/commit/5fd4a37)) (Vincent Weevers)
## [5.1.1] - 2019-11-29

@@ -218,4 +232,2 @@

### Fixed
## [1.2.1] - 2016-12-27

@@ -381,2 +393,4 @@

[6.0.0]: https://github.com/Level/packager/compare/v5.1.1...v6.0.0
[5.1.1]: https://github.com/Level/packager/compare/v5.1.0...v5.1.1

@@ -383,0 +397,0 @@

@@ -1,4 +0,6 @@

var levelup = require('levelup')
var encode = require('encoding-down')
'use strict'
const levelup = require('levelup')
const encode = require('encoding-down')
function packager (leveldown) {

@@ -23,9 +25,9 @@ function Level (location, options, callback) {

['destroy', 'repair'].forEach(function (m) {
for (const m of ['destroy', 'repair']) {
if (typeof leveldown[m] === 'function') {
Level[m] = function () {
leveldown[m].apply(leveldown, arguments)
Level[m] = function (...args) {
leveldown[m](...args)
}
}
})
}

@@ -32,0 +34,0 @@ Level.errors = levelup.errors

{
"name": "level-packager",
"version": "5.1.1",
"description": "LevelUP package helper for distributing with a LevelDOWN-compatible back-end",
"version": "6.0.0",
"description": "levelup package helper for distributing with an abstract-leveldown store",
"license": "MIT",

@@ -9,2 +9,3 @@ "main": "level-packager.js",

"test": "standard && hallmark && nyc node test.js",
"test-browsers-local": "airtap test.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",

@@ -15,14 +16,24 @@ "hallmark": "hallmark --fix",

},
"files": [
"abstract",
"level-packager.js",
"CHANGELOG.md",
"CONTRIBUTORS.md",
"LICENSE.md",
"UPGRADING.md"
],
"dependencies": {
"encoding-down": "^6.3.0",
"levelup": "^4.3.2"
"encoding-down": "^7.0.0",
"levelup": "^5.0.0"
},
"devDependencies": {
"airtap": "^4.0.3",
"airtap-playwright": "^1.0.1",
"coveralls": "^3.0.2",
"dependency-check": "^3.3.0",
"hallmark": "^2.0.0",
"hallmark": "^3.1.0",
"level-community": "^3.0.0",
"nyc": "^14.0.0",
"standard": "^14.0.0",
"tape": "^4.0.0"
"nyc": "^15.1.0",
"standard": "^16.0.3",
"tape": "^5.0.1"
},

@@ -48,4 +59,4 @@ "hallmark": {

"engines": {
"node": ">=6"
"node": ">=10"
}
}
# level-packager
> `levelup` package helper for distributing with an `abstract-leveldown` compatible back-end
> `levelup` package helper for distributing with an `abstract-leveldown` store.

@@ -5,0 +5,0 @@ [![level badge][level-badge]](https://github.com/Level/awesome)

@@ -5,12 +5,37 @@ # Upgrade Guide

## v5
## 6.0.0
Legacy range options have been removed ([Level/community#86](https://github.com/Level/community/issues/86)). If you previously did:
```js
db.createReadStream({ start: 'a', end: 'z' })
```
An error would now be thrown and you must instead do:
```js
db.createReadStream({ gte: 'a', lte: 'z' })
```
The same applies to `db.iterator()`, `db.createKeyStream()` and `db.createValueStream()`.
This release also drops support of legacy runtime environments ([Level/community#98](https://github.com/Level/community/issues/98)):
- Node.js 6 and 8
- Internet Explorer 11
- Safari 9-11
- Stock Android browser (AOSP).
Lastly, in browsers, `process.nextTick()` has been replaced with [`queue-microtask`](https://github.com/feross/queue-microtask), except in streams. In the future we might use `queueMicrotask()` in Node.js too.
## 5.0.0
Upgraded to [`levelup@4`](https://github.com/Level/levelup/blob/v4.0.0/UPGRADING.md#v4) and [`encoding-down@6`](https://github.com/Level/encoding-down/blob/v6.0.0/UPGRADING.md#v6). We recommend to pair `level-packager@5` only with a store based on `abstract-leveldown` >= 6. Please follow the earlier links for more information.
## v4
## 4.0.0
The `test.js` file was rewritten to test the `level-packager` api and is no longer part of the api. Implementations based on `level-packager` should instead use the tests in the `abstract/` folder.
## v3
## 3.0.0
Dropped support for node 4. No other breaking changes.
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