Code Monkey home page Code Monkey logo

level-blocked's Introduction

level-blocked

Blocked data storage on top of LevelUp.

build status

testling badge

key design

'<key>\xffblocks\xff<block index>'

api

var blocks = blocked(db, [blockSize])

  • db: A LevelUp database.
  • blockSize: Each block's maximum size in bytes, defaults to 1024.
var level = require('level');
var blocked = require('level-blocked');

var db = level(__dirname + '/db');
var blocks = blocked(db, 3);

blocks.createReadStream(key[, opts])

Streaming read access.

  • key: The address of your data
  • opts.start: The first byte to read
  • opts.end: The last byte to read
blocks.createReadStream('key').on('data', function(block) {
  console.log('block: %s', block);
  // => block: val
  // => block: ue
});

blocks.read(key[, opts], cb)

Callback / buffered read access.

  • key: The address of your data
  • opts.start: The first byte to read
  • opts.end: The last byte to read
blocks.read('key', function(err, block) {
  if (err) throw err;
  console.log('block: %s', block);
  // => block: value
});

block.createWriteStream(key[, opts])

Streaming write access.

  • key: The address of your data
  • opts.start: Writer after this byte
  • opts.batch: Write to this batch
blocks.createWriteStream('key').end('value');

blocks.write(key[, opts], cb)

Callback write access.

  • key: The address of your data
  • opts.start: Writer after this byte
  • opts.batch: Write to this batch
blocks.write('key', 'value', function(err){
  if (err) throw err;
});

installation

With npm do:

npm install level-blocked

license

(MIT)

Copyright (c) 2013 Julian Gruber <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

level-blocked's People

Contributors

greenkeeper[bot] avatar juliangruber avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

mmalecki

level-blocked's Issues

evaluate counting links instead of reverse index

currently we have an inverse index from file paths to inodes to know how many links still exist during unlink(1) but maybe keeping a ref count in the inode meta data is more efficient. Could not be safe though.

An in-range update of debug is breaking the build 🚨

Version 2.4.0 of debug just got published.

Branch Build failing 🚨
Dependency debug
Current Version 2.3.3
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As debug is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 7 commits .

  • b82d4e6 release 2.4.0
  • 41002f1 Update bower.json (#342)
  • e58d54b Node: configurable util.inspect() options (#327)
  • 00f3046 Node: %O (big O) pretty-prints the object (#322)
  • bd9faa1 allow colours in workers (#335)
  • 501521f Use same color for same namespace. (#338)
  • e2a1955 Revert "handle regex special characters"

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.