{"name":"level-blobs","version":"0.1.0","description":"Save binary blobs in level and stream then back","repository":{"type":"git","url":"git://github.com/mafintosh/level-blobs.git"},"keywords":["level","db","blobs","stream","buffer","data","store"],"dependencies":{"once":"^1.3.0","readable-stream":"^1.0.26-4"},"devDependencies":{"tape":"^2.12.3","memdb":"^0.1.0"},"scripts":{"test":"tape test/*.js"},"bugs":{"url":"https://github.com/mafintosh/level-blobs/issues"},"homepage":"https://github.com/mafintosh/level-blobs","_id":"level-blobs@0.1.0","dist":{"shasum":"d207dbf5636b5a1868040629059340e02d51f3a8","tarball":"http://registry-npm.ywwl.com/level-blobs/download/level-blobs-0.1.0.tgz","integrity":"sha512-MKHz2FAM5nNRo97Dg+u7GoLB+dO3p7exp83GKK5r9BCac/KmgSVTcf8IuUaEmLZqo/WOVh5NgaTLpGOI0DKbpQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBt1c093k44gPOx8/13UU8ZKhn7IwCfzhYbCIRiN0lq/AiArJD6Yu+xyTtAtt9nED2sE+cqpmNu6AyM0q50a5nyIQw=="}],"size":4033,"noattachment":false,"key":"/level-blobs/-/level-blobs-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"readme":"# level-blobs\n\nSave binary blobs in level and stream then back.\nSimilar to [level-store](https://github.com/juliangruber/level-store) but streams2 and with support for random access writes and reads\n\n\tnpm install level-blobs\n\n[![build status](http://img.shields.io/travis/mafintosh/level-filesystem.svg?style=flat)](http://travis-ci.org/mafintosh/level-blobs)\n![dat](http://img.shields.io/badge/Development%20sponsored%20by-dat-green.svg?style=flat)\n\n[![browser support](https://ci.testling.com/mafintosh/level-blobs.png)](https://ci.testling.com/mafintosh/level-blobs)\n\n## Usage\n\n``` js\nvar blobs = require('level-blobs');\nvar level = require('level');\n\nvar db = level('/tmp/my-blobs-db');\nvar bl = blobs(db);\n\n// create a write stream\nvar ws = blobs.createWriteStream('my-file.txt');\n\nws.on('finish', function() {\n\t// lets read the blob and pipe it to stdout\n\tvar rs = blobs.createReadStream('my-file.txt');\n\trs.pipe(process.stdout);\n});\n\nws.write('hello ');\nws.write('world');\nws.end();\n```\n\n## API\n\n#### `blobs(db, opts)`\n\nCreate a new blobs instance. Options default to\n\n``` js\n{\n\tblockSize: 65536, // byte size for each block of data stored\n\tbatch: 100        // batch at max 100 blocks when writing\n}\n```\n\n#### `bl.createReadStream(name, opts)`\n\nCreate a read stream for `name`. Options default to\n\n``` js\n{\n\tstart: 0       // start reading from this byte offset\n\tend: Infinity  // end at end-of-file or this offset (inclusive)\n}\n```\n\n#### `bl.createWriteStream(name, opts)`\n\nCreate a write stream to `name`. Options default to\n\n``` js\n{\n\tstart: 0       // start writing at this offset\n\t               // if append === true start defaults to end-of-file\n\tappend: false  // set to true if you want to append to the file\n\t               // if not true the file will be truncated before writing\n}\n```\n\n#### `bl.read(name, opts, cb)`\n\nCreate a read stream and buffer the stream into a single buffer that is passed to the callback.\nOptions are passed to `createReadStream`.\n\n#### `bl.write(name, data, opts, cb)`\n\nWrite `data` to `name` and call the callback when done.\nOptions are passed to `createWriteStream`.\n\n#### `bl.remove(name, cb)`\n\nRemove `name` from the blob store\n\n## License\n\nMIT\n","publish_time":1396898626005,"_cnpm_publish_time":1396898626005,"dist-tags":{"latest":"0.1.7"}}