npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

leveldb

v0.7.1

Published

Bindings for using LevelDB through node.

Downloads

102

Readme

Build Status

Node-LevelDB

The leveldb library provides a persistent key value store. Keys and values are arbitrary byte arrays. The keys are ordered within the key value store according to a user-specified comparator function.

This project is node bindings to this excellent library so that node programs can either implement their own custom databases or simply use it directly as a fast, simple key/value store.

While implementing nStore, I realized there are a couple things that V8 and node are not very good at. They are heavy disk I/O and massive objects with either millions of keys or millions of sub objects.

Since LevelDB provides good primitives like MVCC and binary support (It was designed to back IndexDB in the Chrome browser), then it can be used as a base to implement things like CouchDB.

Usage

var leveldb = require('leveldb');
leveldb.open("path/to/my/db", { create_if_missing: true }, onOpen);

function onOpen(err, db) {
  var key = "mykey";
  db.put(key, "My Value!", function(err) {
    db.get(key, function(err, value) {
      console.dir(value); // prints: My Value!
      db.del(key);
    });
  });
}

Installing

To compile native code and CoffeeScript do:

npm install

Testing

To run tests do:

npm test

You can also view the current build status on Travis-CI.

Stripping the library

The leveldb library is bundled in the deps folder and is compiled in staticly. The resulting node addon is about 4mb unstripped. If you want to make it smaller, I've had success using the strip command on it which shrinks it down to about 300kb.

strip build/default/leveldb.node

Contributing

Since I am not experienced in the world of C++ and am still learning, I welcome contributions. Mainly what I need right now is someone with experience to review my code and tell me things I'm doing stupid. Maybe add a C++ best pratices note to this document.

Currently Randall Leeds (@tilgovi and one of the CouchDB commiters) has expressed interest in helping and already has commit rights to the project.

Contributors

   176  Michael Phan-Ba
    55  Nathan Landis
    39  Tim Caswell
    19  [email protected]
    15  [email protected]
    12  [email protected]
    12  Stefan Thomas
     9  Randall Leeds
     9  Carter Thaxton
     6  Damon Oehlman
     5  Hans Wennborg
     4  shinuza
     3  [email protected]
     2  Sanjay Ghemawat
     1  (no author)
     1  Paul Vorbach
     1  justmoon
     1  Gabor Cselle