Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

remove sublevel from deps, switch to tape from tap

  • Loading branch information...
commit 9ef71eb33c685853d8ed0ebc135ef0ecf740a045 1 parent c1c4157
Rod Vagg authored July 15, 2013
10  README.md
Source Rendered
@@ -2,15 +2,21 @@
2 2
 
3 3
 ![LevelDB Logo](https://twimg0-a.akamaihd.net/profile_images/3360574989/92fc472928b444980408147e5e5db2fa_bigger.png)
4 4
 
  5
+[![NPM](https://nodei.co/npm/level-ttl.png?downloads)](https://nodei.co/npm/level-ttl/)
  6
+
5 7
 **Add a `'ttl'` (time-to-live) option to LevelUP for `put()` and `batch()`**
6 8
 
7 9
 Augment LevelUP to handle a new `'ttl'` option on `put()` and `batch()` that specifies the number of milliseconds an entry should remain in the data store. After the TTL, the entry will be automatically cleared for you.
8 10
 
  11
+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.
  12
+
9 13
 ```js
10  
-var levelup = require('levelup')
11  
-  , ttl     = require('level-ttl')
  14
+var levelup  = require('level')
  15
+  , ttl      = require('level-ttl')
  16
+  , sublevel = require('level-sublevel')
12 17
 
13 18
 levelup('/tmp/foo.db', function (err, db) {
  19
+  db = sublevel(db)
14 20
   db = ttl(db)
15 21
 
16 22
   // --------------------------- put() --------------------------- //
4  package.json
@@ -18,15 +18,15 @@
18 18
     }
19 19
   , "dependencies"     : {
20 20
         "after"            : "~0.8.1"
21  
-      , "level-sublevel"   : "~4.7.1"
22 21
       , "xtend"            : "~2.0.6"
23 22
     }
24 23
   , "peerDependencies" : {
25 24
     }
26 25
   , "devDependencies"  : {
27  
-        "tap"              : "*"
  26
+        "tape"             : "*"
28 27
       , "level"            : "*"
29 28
       , "rimraf"           : "*"
  29
+      , "level-sublevel"   : "*"
30 30
     }
31 31
   , "scripts"          : {
32 32
         "test"             : "node ./test.js"
12  test.js
... ...
@@ -1,9 +1,16 @@
1  
-const test     = require('tap').test
  1
+const test     = require('tape')
2 2
     , rimraf   = require('rimraf')
3 3
     , levelup  = require('level')
  4
+    , sublevel = require('level-sublevel')
4 5
     , ttl      = require('./')
5 6
 
6  
-var ltest = function (name, fn, opts) {
  7
+function fixtape (t) {
  8
+  t.like = function (str, reg, msg) {
  9
+    t.ok(reg.test(str), msg)
  10
+  }
  11
+}
  12
+
  13
+function ltest (name, fn, opts) {
7 14
   test(name, function (t) {
8 15
     var location = '__ttl-' + Math.random()
9 16
       , db
@@ -15,6 +22,7 @@ var ltest = function (name, fn, opts) {
15 22
         rimraf(location, t._end.bind(t))
16 23
       })
17 24
     }
  25
+    fixtape(t)
18 26
 
19 27
     levelup(location, opts, function (err, _db) {
20 28
       t.notOk(err, 'no error on open()')

0 notes on commit 9ef71eb

Please sign in to comment.
Something went wrong with that request. Please try again.