Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
pull-level
Advanced tools
pull-stream interface to levelup
read items in database.
var pl = require('pull-level')
var pull = require('pull-stream')
var db = require('levelup')('/tmp/pull-level-example')
pl.read(db)
.pipe(pull.collect(console.log))
read items in database, plus realtime changes
pl.read(db, {tail: true})
//log data as it comes,
//because tail will keep the connection open
//so we'll never see the end otherwise.
.pipe(pull.through(console.log))
//note, pull-streams will not drain unless something is
//pulling the data through, so we have to add drain
//even though the data we want is coming from pull.through()
.pipe(pull.drain())
If you just want the realtime inserts,
use live
pl.live(db, {tail: true})
.pipe(pull.through(console.log))
.pipe(pull.drain())
To write, pipe batch changes into write
pull.values([
{key: 0, value: 'zero', type: 'put'},
{key: 1, value: 'one', type: 'put'},
{key: 2, value: 'two', type: 'put'},
]).pipe(pl.write(db))
If you are lazy/busy, you can leave off type
.
In that case, if value
is non-null, the change
is considered a put
else, a del
.
pull.values([
{key: 0, value: 'zero'},
{key: 1, value: 'one'},
{key: 2, value: 'two'},
]).pipe(pl.write(db))
With pull-level it's easy to create indexes. just save a pointer to the key.
like this:
pull.values([
{key: key, value: VALUE, type: 'put'},
{key: '~INDEX~' + VALUE.prop, value: key, type: 'put'},
]).pipe(pl.write(db))
then, when you want to do a read
, use asyncMap
pl.read(db, {min: '~INDEX~', max: '~INDEX~~'})
.pipe(pull.asyncMap(function (e, cb) {
db.get(e.value, function (value) {
cb(null, {key: e.value, value: value})
})
})
.pipe(pull.collect(console.log))
MIT
FAQs
pull-stream interface to levelup
The npm package pull-level receives a total of 12,328 weekly downloads. As such, pull-level popularity was classified as popular.
We found that pull-level 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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.