Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
level-ws
Advanced tools
Changelog
[4.0.0] - 2022-07-01
If you are upgrading: please see UPGRADING.md
.
readable-stream
from 3 to 4 (082b8d6
) (Vincent Weevers)new
(dafafb2
) (Vincent Weevers)817c30c
) (Vincent Weevers)94a2a8e
) (Vincent Weevers).Readme
A basic writable stream for abstract-level
databases, using Node.js core streams. This is not a high-performance stream. If benchmarking shows that your particular usage does not fit then try one of the alternative writable streams that are optimized for different use cases.
:pushpin: To instead write data using Web Streams, see
level-web-stream
.
If you are upgrading: please see UPGRADING.md
.
const { Level } = require('level')
const WriteStream = require('level-ws')
const db = new Level('./db', { valueEncoding: 'json' })
const ws = new WriteStream(db)
ws.on('close', function () {
console.log('Done!')
})
ws.write({ key: 'alice', value: 42 })
ws.write({ key: 'bob', value: 7 })
// To delete entries, specify an explicit type
ws.write({ type: 'del', key: 'tomas' })
ws.write({ type: 'put', key: 'sara', value: 16 })
ws.end()
ws = new WriteStream(db[, options])
Create a writable stream that operates in object mode, accepting batch operations to be committed with db.batch()
on each tick of the Node.js event loop. The optional options
argument may contain:
type
(string, default: 'put'
): default batch operation type if not set on indididual operations.maxBufferLength
(number, default Infinity
): limit the size of batches. When exceeded, the stream will stop processing writes until the current batch has been committed.highWaterMark
(number, default 16
): buffer level when stream.write()
starts returning false.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 for more details.
FAQs
A basic writable stream for abstract-level databases
We found that level-ws demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).