level-blobs

WebJar for level-blobs

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

level-blobs
Последняя версия

Последняя версия

0.1.7
Дата

Дата

Тип

Тип

jar
Описание

Описание

level-blobs
WebJar for level-blobs
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/mafintosh/level-blobs

Скачать level-blobs

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/level-blobs/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>level-blobs</artifactId>
    <version>0.1.7</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/level-blobs/
implementation 'org.webjars.npm:level-blobs:0.1.7'
// https://jarcasting.com/artifacts/org.webjars.npm/level-blobs/
implementation ("org.webjars.npm:level-blobs:0.1.7")
'org.webjars.npm:level-blobs:jar:0.1.7'
<dependency org="org.webjars.npm" name="level-blobs" rev="0.1.7">
  <artifact name="level-blobs" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='level-blobs', version='0.1.7')
)
libraryDependencies += "org.webjars.npm" % "level-blobs" % "0.1.7"
[org.webjars.npm/level-blobs "0.1.7"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.webjars.npm : once jar [1.3.0,2)
org.webjars.npm : readable-stream jar [1.0.26-4,2)
org.webjars.npm : level-peek jar [1.0.6]

Модули Проекта

Данный проект не имеет модулей.

level-blobs

Save binary blobs in level and stream then back. Similar to level-store but streams2 and with support for random access writes and reads

npm install level-blobs

build status dat

browser support

Usage

var blobs = require('level-blobs');
var level = require('level');

var db = level('/tmp/my-blobs-db');
var bl = blobs(db);

// create a write stream
var ws = blobs.createWriteStream('my-file.txt');

ws.on('finish', function() {
	// lets read the blob and pipe it to stdout
	var rs = blobs.createReadStream('my-file.txt');
	rs.pipe(process.stdout);
});

ws.write('hello ');
ws.write('world');
ws.end();

API

blobs(db, opts)

Create a new blobs instance. Options default to

{
	blockSize: 65536, // byte size for each block of data stored
	batch: 100        // batch at max 100 blocks when writing
}

bl.createReadStream(name, opts)

Create a read stream for name. Options default to

{
	start: 0       // start reading from this byte offset
	end: Infinity  // end at end-of-file or this offset (inclusive)
}

bl.createWriteStream(name, opts)

Create a write stream to name. Options default to

{
	start: 0       // start writing at this offset
	               // if append === true start defaults to end-of-file
	append: false  // set to true if you want to append to the file
	               // if not true the file will be truncated before writing
}

bl.read(name, opts, cb)

Create a read stream and buffer the stream into a single buffer that is passed to the callback. Options are passed to createReadStream.

bl.write(name, data, opts, cb)

Write data to name and call the callback when done. Options are passed to createWriteStream.

bl.remove(name, cb)

Remove name from the blob store

License

MIT

Версии библиотеки

Версия
0.1.7