🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

wodb

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wodb

Single file Write-Once Database with efficient random access on bigger datasets

latest
Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

wodb

Single file Write-Once Database with efficient random access on bigger datasets

npm install wodb

(WIP)

Usage

const wodb = require('wodb')

// First create a database (all data will be stored in ./my.db as JSON)
const ws = wodb.createWriteStream('my.db')

// Write a ton of data to it
for (var i = 0; i < 10000; i++) {
  ws.write({
    key: i,
    value: `this is a value: ${i}`
  })
}

ws.end(function () {
  // our wodb is now fully written and cannot be updated again.
  // to query it make an instance
  const db = wodb('my.db')

  db.get(42, function (err, doc) {
    console.log(doc) // prints {key: 42, value: 'this is a value: 42'}
  })
})

License

MIT

FAQs

Package last updated on 29 Apr 2018

Did you know?

Socket

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.

Install

Related posts