Comparing version 1.0.0 to 2.0.0
129
CHANGELOG.md
# Changelog | ||
## [Unreleased] | ||
_**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md)._ | ||
## [Unreleased][unreleased] | ||
## [2.0.0] - 2019-03-30 | ||
### Changed | ||
- Upgrade `readable-stream` from `^2.2.8` to `^3.1.0` ([#105](https://github.com/Level/level-ws/issues/105)) ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Upgrade `level` devDependency from `^4.0.0` to `^5.0.1` ([#109](https://github.com/Level/level-ws/issues/109)) ([**@vweevers**](https://github.com/vweevers)) | ||
- Upgrade `nyc` devDependency from `^12.0.2` to `^13.2.0` ([#108](https://github.com/Level/level-ws/issues/108)) ([**@vweevers**](https://github.com/vweevers)) | ||
- Upgrade `standard` devDependency from `^11.0.1` to `^12.0.0` ([#102](https://github.com/Level/level-ws/issues/102)) ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Apply common project tweaks ([#106](https://github.com/Level/level-ws/issues/106), [#107](https://github.com/Level/level-ws/issues/107)) ([**@vweevers**](https://github.com/vweevers)) | ||
### Removed | ||
- Remove node 9 ([`6e1ef3b`](https://github.com/Level/level-ws/commit/6e1ef3b)) ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
## [1.0.0] - 2018-06-30 | ||
### Changed | ||
* Refactor test options to always set `createIfMissing` and `errorIfExists` (@ralphtheninja) | ||
* Move `setUp()` function into `test()` (@ralphtheninja) | ||
* Move `openTestDatabase()` calls into `test()` and pass `ctx` to tests (@ralphtheninja) | ||
* Test error after `db.close()` and after `cleanup()` (@ralphtheninja) | ||
* Use `after` in `cleanup()` (@ralphtheninja) | ||
* Use only `readable-stream` from user land (@ralphtheninja) | ||
* Use `^` for devDependencies (@ralphtheninja) | ||
* Switch to plain MIT license (@ralphtheninja) | ||
* Replace `util.inherits` with `inherits` module (@ralphtheninja) | ||
* Replace `this._destroyed` with `this.destroyed` from `Writable` (@ralphtheninja) | ||
* Export single function that creates the stream (@ralphtheninja) | ||
* Flip parameters in `WriteStream` constructor (@ralphtheninja) | ||
* Verify results once using `level-concat-iterator` intead of multiple `db.get()` operations (@ralphtheninja) | ||
* Update README style (@ralphtheninja) | ||
* Optimize internal batch `_buffer` by pushing transformed data (@ralphtheninja) | ||
* Use `tempy` for test locations and remove `cleanup()` (@vweevers) | ||
* Pass complete object in `_write()` extending default type (@ralphtheninja) | ||
* Link to node 8 lts version of `Writable` (@ralphtheninja) | ||
* Support custom `highWaterMark` (@vweevers) | ||
* Change `maxBufferLength` to pause rather than drop writes (@vweevers) | ||
- Refactor test options to always set `createIfMissing` and `errorIfExists` ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Move `setUp()` function into `test()` ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Move `openTestDatabase()` calls into `test()` and pass `ctx` to tests ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Test error after `db.close()` and after `cleanup()` ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Use `after` in `cleanup()` ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Use only `readable-stream` from user land ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Use `^` for devDependencies ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Switch to plain MIT license ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Replace `util.inherits` with `inherits` module ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Replace `this._destroyed` with `this.destroyed` from `Writable` ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Export single function that creates the stream ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Flip parameters in `WriteStream` constructor ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Verify results once using `level-concat-iterator` intead of multiple `db.get()` operations ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Update README style ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Optimize internal batch `_buffer` by pushing transformed data ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Use `tempy` for test locations and remove `cleanup()` ([**@vweevers**](https://github.com/vweevers)) | ||
- Pass complete object in `_write()` extending default type ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Link to node 8 lts version of `Writable` ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Support custom `highWaterMark` ([**@vweevers**](https://github.com/vweevers)) | ||
- Change `maxBufferLength` to pause rather than drop writes ([**@vweevers**](https://github.com/vweevers)) | ||
### Added | ||
* Add node 6, 8, 9 and 10 to Travis (@ralphtheninja) | ||
* Add `standard` for linting (@ralphtheninja) | ||
* Test race condition (@vweevers) | ||
* Add `nyc` and `coveralls` (@vweevers) | ||
* Add `CHANGELOG.md` (@ralphtheninja) | ||
* Add `UPGRADING.md` (@ralphtheninja) | ||
* Test `maxBufferLength` (@vweevers) | ||
* Test edge cases (@vweevers) | ||
- Add node 6, 8, 9 and 10 to Travis ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Add `standard` for linting ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Test race condition ([**@vweevers**](https://github.com/vweevers)) | ||
- Add `nyc` and `coveralls` ([**@vweevers**](https://github.com/vweevers)) | ||
- Add `CHANGELOG.md` ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Add `UPGRADING.md` ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Test `maxBufferLength` ([**@vweevers**](https://github.com/vweevers)) | ||
- Test edge cases ([**@vweevers**](https://github.com/vweevers)) | ||
### Removed | ||
* Remove node 0.10, 2, 3, 4 and 5 from Travis (@ralphtheninja) | ||
* Remove `contributors` from `package.json` (@ralphtheninja) | ||
* Remove copyright headers from code (@ralphtheninja) | ||
* Remove `this.{writable,readable}` state (@ralphtheninja) | ||
* Remove `this._db.isOpen()` checks (@ralphtheninja) | ||
* Remove patching db from the API (@ralphtheninja) | ||
* Remove default `'utf8'` encoding and per stream encodings (@ralphtheninja, @vweevers) | ||
* Remove `.jshintrc` (@ralphtheninja) | ||
* Remove `WriteStream#destroySoon()` (@vweevers) | ||
* Remove `WriteStream#toString()` (@vweevers) | ||
* Remove redundant `!buffer` check (@vweevers) | ||
- Remove node 0.10, 2, 3, 4 and 5 from Travis ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Remove `contributors` from `package.json` ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Remove copyright headers from code ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Remove `this.{writable,readable}` state ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Remove `this._db.isOpen()` checks ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Remove patching db from the API ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Remove default `'utf8'` encoding and per stream encodings ([**@ralphtheninja**](https://github.com/ralphtheninja), [**@vweevers**](https://github.com/vweevers)) | ||
- Remove `.jshintrc` ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Remove `WriteStream#destroySoon()` ([**@vweevers**](https://github.com/vweevers)) | ||
- Remove `WriteStream#toString()` ([**@vweevers**](https://github.com/vweevers)) | ||
- Remove redundant `!buffer` check ([**@vweevers**](https://github.com/vweevers)) | ||
### Fixed | ||
* Fix erroneous test on missing type (@ralphtheninja) | ||
* Fix race condition by flushing before finish (@vweevers) | ||
* Fix `_destroy` to emit `'close'` after error (@vweevers) | ||
- Fix erroneous test on missing type ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
- Fix race condition by flushing before finish ([**@vweevers**](https://github.com/vweevers)) | ||
- Fix `_destroy` to emit `'close'` after error ([**@vweevers**](https://github.com/vweevers)) | ||
## [0.1.0] - 2017-04-07 | ||
### Changed | ||
* Upgrade `readable-stream` from `~2.0.6` to `^2.2.8` (@mcollina) | ||
* Upgrade `xtend` from `~2.2.1` to `^4.0.0` (@mcollina) | ||
- Upgrade `readable-stream` from `~2.0.6` to `^2.2.8` ([**@mcollina**](https://github.com/mcollina)) | ||
- Upgrade `xtend` from `~2.2.1` to `^4.0.0` ([**@mcollina**](https://github.com/mcollina)) | ||
## [0.0.1] - 2016-03-14 | ||
### Changed | ||
* Upgrade `readable-stream` from `~1.0.15` to `~2.0.6` (@rvagg, @greenkeeper) | ||
* Use `__dirname` instead of temporary directory (@rvagg) | ||
* Update logo and copyright (@ralphtheninja) | ||
- Upgrade `readable-stream` from `~1.0.15` to `~2.0.6` ([**@rvagg**](https://github.com/rvagg), [**@greenkeeper**](https://github.com/greenkeeper)) | ||
- Use `__dirname` instead of temporary directory ([**@rvagg**](https://github.com/rvagg)) | ||
- Update logo and copyright ([**@ralphtheninja**](https://github.com/ralphtheninja)) | ||
### Added | ||
* Add Travis (@rvagg) | ||
- Add Travis ([**@rvagg**](https://github.com/rvagg)) | ||
## 0.0.0 - 2013-10-12 | ||
@@ -77,6 +100,10 @@ | ||
[Unreleased]: https://github.com/level/level-ws/compare/v1.0.0...HEAD | ||
[unreleased]: https://github.com/level/level-ws/compare/v2.0.0...HEAD | ||
[2.0.0]: https://github.com/level/level-ws/compare/v1.0.0...v2.0.0 | ||
[1.0.0]: https://github.com/level/level-ws/compare/v0.1.0...v1.0.0 | ||
[0.1.0]: https://github.com/level/level-ws/compare/v0.0.1...v0.1.0 | ||
[0.0.1]: https://github.com/level/level-ws/compare/v0.0.0...v0.0.1 | ||
@@ -93,14 +93,6 @@ var Writable = require('readable-stream').Writable | ||
WriteStream.prototype._destroy = function (err, cb) { | ||
var self = this | ||
this._buffer = null | ||
cb(err) | ||
// TODO when the next readable-stream (mirroring node v10) is out: | ||
// remove this. Since nodejs/node#19836, streams always emit close. | ||
process.nextTick(function () { | ||
self.emit('close') | ||
}) | ||
} | ||
module.exports = WriteStream |
# The MIT License (MIT) | ||
## Copyright (c) 2018 `level-ws` contributors | ||
**Copyright © 2012-present [Contributors](CONTRIBUTORS.md).** | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
{ | ||
"name": "level-ws", | ||
"version": "2.0.0", | ||
"description": "A basic WriteStream implementation for LevelUP", | ||
"version": "1.0.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Level/level-ws.git" | ||
"license": "MIT", | ||
"main": "level-ws.js", | ||
"scripts": { | ||
"test": "standard && hallmark && nyc node test.js", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"hallmark": "hallmark --fix", | ||
"dependency-check": "dependency-check . test.js", | ||
"prepublishOnly": "npm run dependency-check" | ||
}, | ||
"homepage": "https://github.com/Level/level-ws", | ||
"keywords": [ | ||
"leveldb", | ||
"stream", | ||
"levelup" | ||
], | ||
"main": "level-ws.js", | ||
"dependencies": { | ||
"inherits": "^2.0.3", | ||
"readable-stream": "^2.2.8", | ||
"readable-stream": "^3.1.0", | ||
"xtend": "^4.0.1" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "~3.0.1", | ||
"level": "^4.0.0", | ||
"coveralls": "^3.0.1", | ||
"dependency-check": "^3.3.0", | ||
"hallmark": "^0.1.0", | ||
"level": "^5.0.1", | ||
"level-community": "^3.0.0", | ||
"level-concat-iterator": "^2.0.0", | ||
"nyc": "~12.0.2", | ||
"secret-event-listener": "~1.0.0", | ||
"standard": "^11.0.1", | ||
"nyc": "^13.2.0", | ||
"secret-event-listener": "^1.0.0", | ||
"standard": "^12.0.0", | ||
"tape": "^4.9.0", | ||
"tempy": "^0.2.1" | ||
}, | ||
"scripts": { | ||
"test": "standard && nyc node test.js", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls" | ||
"hallmark": { | ||
"community": "level-community", | ||
"ignore": [ | ||
"CONTRIBUTORS.md" | ||
] | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Level/level-ws.git" | ||
}, | ||
"homepage": "https://github.com/Level/level-ws", | ||
"keywords": [ | ||
"level", | ||
"leveldb", | ||
"stream", | ||
"levelup" | ||
], | ||
"engines": { | ||
@@ -37,0 +50,0 @@ "node": ">=6" |
# level-ws | ||
> A basic WriteStream implementation for [levelup](https://github.com/level/levelup) | ||
> A basic WriteStream implementation for [levelup](https://github.com/Level/levelup) | ||
[![level badge][level-badge]](https://github.com/level/awesome) | ||
[![npm](https://img.shields.io/npm/v/level-ws.svg)](https://www.npmjs.com/package/level-ws) | ||
![Node version](https://img.shields.io/node/v/level-ws.svg) | ||
[![Build Status](https://img.shields.io/travis/Level/level-ws.svg)](http://travis-ci.org/Level/level-ws) | ||
[![dependencies](https://david-dm.org/Level/level-ws.svg)](https://david-dm.org/level/level-ws) | ||
[![npm](https://img.shields.io/npm/dm/level-ws.svg)](https://www.npmjs.com/package/level-ws) | ||
[![level badge][level-badge]](https://github.com/Level/awesome) | ||
[![npm](https://img.shields.io/npm/v/level-ws.svg?label=&logo=npm)](https://www.npmjs.com/package/level-ws) | ||
[![Node version](https://img.shields.io/node/v/level-ws.svg)](https://www.npmjs.com/package/level-ws) | ||
[![Travis](https://img.shields.io/travis/Level/level-ws.svg?logo=travis&label=)](https://travis-ci.org/Level/level-ws) | ||
[![npm](https://img.shields.io/npm/dm/level-ws.svg?label=dl)](https://www.npmjs.com/package/level-ws) | ||
[![Coverage Status](https://coveralls.io/repos/github/Level/level-ws/badge.svg)](https://coveralls.io/github/Level/level-ws) | ||
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) | ||
[![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) | ||
@@ -38,5 +39,5 @@ `level-ws` provides the most basic general-case WriteStream for `levelup`. It was extracted from the core `levelup` at version 0.18.0. | ||
* `type` *(string, default: `'put'`)*: Default batch operation for missing `type` property during `ws.write()`. | ||
- `type` _(string, default: `'put'`)_: Default batch operation for missing `type` property during `ws.write()`. | ||
The WriteStream will buffer writes and submit them as a `batch()` operations where writes occur *within the same tick*. | ||
The WriteStream will buffer writes and submit them as a `batch()` operations where writes occur _within the same tick_. | ||
@@ -92,3 +93,3 @@ ```js | ||
If the *WriteStream* is created with a `'type'` option of `'del'`, all `write()` operations will be interpreted as `'del'`, unless explicitly specified as `'put'`. | ||
If the _WriteStream_ is created with a `'type'` option of `'del'`, all `write()` operations will be interpreted as `'del'`, unless explicitly specified as `'put'`. | ||
@@ -113,6 +114,26 @@ ```js | ||
## Contributing | ||
[`Level/level-ws`](https://github.com/Level/level-ws) 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](https://github.com/Level/community/blob/master/CONTRIBUTING.md) for more details. | ||
## Donate | ||
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), [npm](https://www.npmjs.com/) packages and (soon) [our website](http://leveldb.org). 💖 | ||
### 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 `level-ws` [Contributors](./CONTRIBUTORS.md). | ||
[MIT](LICENSE.md) © 2012-present [Contributors](CONTRIBUTORS.md). | ||
[level-badge]: http://leveldb.org/img/badge.svg |
@@ -5,2 +5,6 @@ # Upgrade Guide | ||
## v2 | ||
Dropped node 9 and upgraded to [`readable-stream@3`](https://github.com/nodejs/readable-stream#version-3xx). | ||
## v1 | ||
@@ -10,3 +14,3 @@ | ||
------------------------------------ | ||
* * * | ||
@@ -31,3 +35,3 @@ The API only exports a single function and no longer patches `levelup`. | ||
------------------------------------ | ||
* * * | ||
@@ -52,15 +56,15 @@ The parameters to the stream constructor were flipped. | ||
------------------------------------ | ||
* * * | ||
The behavior of `maxBufferLength` was changed. Previously all write operations exceeding `maxBufferLength` in the same tick were dropped. Instead the stream is now paused until a batch has been flushed and unpaused once the batch has been completed. | ||
------------------------------------ | ||
* * * | ||
`WriteStream#destroySoon()` was removed. | ||
------------------------------------ | ||
* * * | ||
Internally `this.writable` and `this.readable` were removed. However, `this.writable` still exists due to inheritance, but `this.readable` is now `undefined`. | ||
------------------------------------ | ||
* * * | ||
@@ -67,0 +71,0 @@ Default `'utf8'` encoding was removed and also per stream encodings. However, it's still possible to specify encodings for individual entries. This means if you previously relied on per stream encodings, you must specify this in calls to `.write()`: |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
34473
137
11
536
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedisarray@1.0.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
Updatedreadable-stream@^3.1.0