Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

level-ttl

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

level-ttl - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

2

level-ttl.js

@@ -53,2 +53,4 @@ const after = require('after')

}, checkFrequency)
if (db._ttl.intervalId.unref)
db._ttl.intervalId.unref()
}

@@ -55,0 +57,0 @@

2

package.json

@@ -9,3 +9,3 @@ {

],
"version": "0.5.0",
"version": "0.6.0",
"homepage": "https://github.com/rvagg/node-level-ttl",

@@ -12,0 +12,0 @@ "authors": [

@@ -11,3 +11,3 @@ # Level TTL [![Build Status](https://secure.travis-ci.org/rvagg/node-level-ttl.png)](http://travis-ci.org/rvagg/node-level-ttl)

Requires [LevelUP](https://github.com/rvagg/node-levelup) (or [Level](https://github.com/level/level)) and [sublevel](https://github.com/dominictarr/level-sublevel) to be installed separately.
Requires [LevelUP](https://github.com/rvagg/node-levelup) (or [Level](https://github.com/level/level)) to be installed separately.

@@ -17,6 +17,4 @@ ```js

, ttl = require('level-ttl')
, sublevel = require('level-sublevel')
levelup('/tmp/foo.db', function (err, db) {
db = sublevel(db)
db = ttl(db)

@@ -62,3 +60,3 @@

**Level TTL** uses a timer to regularly check for expiring entries (don't worry, the whole data store isn't scanned, it's very efficient!) but this can cause problems for processes that have a limited lifespan; particularly when testing. The `db.close()` method is automatically wired to stop the timer but there is also a more explicit <b><code>db.stop()</code></b> method that will stop the timer and not pass on to a `close()` underlying LevelUP instance.
**Level TTL** uses a timer to regularly check for expiring entries (don't worry, the whole data store isn't scanned, it's very efficient!). The `db.close()` method is automatically wired to stop the timer but there is also a more explicit <b><code>db.stop()</code></b> method that will stop the timer and not pass on to a `close()` underlying LevelUP instance.

@@ -65,0 +63,0 @@ ## Contributors

@@ -18,7 +18,7 @@ const test = require('tape')

t._end = t.end
t.__end = t.end
t.end = function () {
db.close(function (err) {
t.notOk(err, 'no error on close()')
rimraf(location, t._end.bind(t))
rimraf(location, t.__end.bind(t))
})

@@ -371,3 +371,3 @@ }

test('test stop() method stops interval and doesn\'t hold process up', function (t) {
t.plan(8)
t.plan(9)

@@ -417,3 +417,5 @@ var location = '__ttl-' + Math.random()

t.equals(0, intervals, 'all interval timers cleared')
rimraf(location, t.end.bind(t))
rimraf(location, function () {
t.ok('rimraffed')
})
})

@@ -420,0 +422,0 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc