
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
Create a temporary sublevel that is guaranteed to be empty.
npm install level-temp
var temp = require('level-temp')
var tmp = temp(db) // where db is a levelup
// call tmp to get a temporary sublevel that is empty
var a = tmp()
a.put('hello', 'world', function () {
a.createReadStream()
.on('data', function (data) {
console.log('a has only one', data)
})
})
// call tmp again to get another empty sublevel
var b = tmp()
b.put('hej', 'verden', function () {
b.createReadStream()
.on('data', function (data) {
console.log('b has only one', data)
})
})
If you explicitly close the tmp database (using tmpDb.close()) the contents will
be removed. If you restart your application previous tmp data will be overriden as well.
tmp = temp(db, [options])Create a new temporary sublevel generator. Options are used as default for any tmp databases created afterwards.
Optionally you can set prefix to a string that will prefix all tmp sublevels created.
var tmp = temp(db, {valueEncoding: 'json'}) // set valueEncoding: json all tmp sublevels
var tmpDb = tmp([options])Create a new temporary sublevel.
Any options passed here are forwarded to levelup
with the default values from the temp constructor mixed in.
Per default an increasing number is used to prefix the temporary sublevels.
To change this set the prefix to whatever string you want to use as a prefix.
The returned tmpDb is a regular levelup that will have its contents garbage collected when you call tmpDb.close()
or at some point in the future when the temporary sublevel prefix is being reused.
MIT
FAQs
Create a temporary sublevel that is guaranteed to be empty
We found that level-temp 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
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.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.