
Product
Introducing Custom Tabs for Org Alerts
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.
level-stream
Advanced tools
Persist streams in LevelDB.
Store a file in LevelDB under the key file and read it out again:
var stream = require('level-stream');
var levelup = require('levelup');
var fs = require('fs');
var db = levelup('/tmp/level-stream');
fs.createReadStream(__dirname + '/file.txt')
.pipe(stream(db, 'file'))
.on('end', function () {
// file.txt is stored in leveldb now
stream(db, 'file').pipe(process.stdout);
});
When reading fails you might not want to start over again completely but rather resume
after the last chunk you received. First, pass ts : true as an option so you don't only
get the stored chunks but also when they were written:
stream(db, 'file', { ts : true }).on('data', console.log);
// => { ts : 1363783762087, data : <Buffer aa aa> }
Now you only need store the timestamp of the last read chunk in a variable and you can
resume reading after an error, passing { since : ts }:
stream(db, 'file', { since : 1363783762087 }).on('data', console.log);
// => { ts : 1363783876109, data : <Buffer bb bb> }
Returns a Duplex Stream.
If you start reading from it it replays the stream stored at key.
If you write to it it persists written data at key.
Possible options are:
ts (Boolean) : If true, don't emit raw chunks but rather objects having ts and data fields.since (Number): When reading, only read data that has been stored after that date.
Automatically sets ts to true.live (Boolen): If true, the stream will stay open, emitting new data as it comes in.Extend db with the db#stream so you can do
db.stream('file')
stream(db).createReadStream(key[, opts])With npm do
$ npm install level-stream
(MIT)
FAQs
Persist streams in leveldb.
The npm package level-stream receives a total of 1 weekly downloads. As such, level-stream popularity was classified as not popular.
We found that level-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Product
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.