# random-access-blob

> A random access storage interface for Blob instances (like File).

Latest version **0.1.2** (published 2020-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install random-access-blob
pnpm add random-access-blob
yarn add random-access-blob
bun add random-access-blob
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2020-05-25 |
| First published | 2020-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Joseph Werle |
| Maintainers | werle |
| Keywords | random, access, storage, blob, browser, file |

## Links

- npm: https://www.npmjs.com/package/random-access-blob
- Repository: https://github.com/little-core-labs/random-access-blob
- Homepage: https://github.com/little-core-labs/random-access-blob#readme
- Issues: https://github.com/little-core-labs/random-access-blob/issues
- npm.io page: https://npm.io/package/random-access-blob

## Dependencies (1)

- [random-access-storage](https://npm.io/package/random-access-storage.md) ^1.4.1

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.1.2 (latest) — 2020-05-25
- 0.1.1 — 2020-05-25
- 0.1.0 — 2020-05-25

## README

random-access-blob
==================

> A [random access storage][ras] interface for [Blob][blob] instances (like [File][file]).

## Installation

```sh
$ npm install random-access-blob
```

## Usage

```js
const rab = require('random-access-blob')
const blob = new Blob([ someTypedArray ])
const storage = rab(blob)

storage.read(0, 4, (err, buf) => {
  // handle 4 byte buffer
})
```

## API

### `storage = require('random-access-blob')(blob[, options])`

Create a `RandomAccessBlob` instance from a [`blob`][blob] that is "readable"
and "statable". `options` can be:

```js
{
  offset: 0, // An optional offset to start reading from in the Blob
}
```

### `storage = require('random-access-blob/file')(file[, options])`

Create a `RandomAccessBlobFile` instance from a [`file`][file] that is
"readable" and "statable".

```js
{
  offset: 0, // An optional offset to start reading from in the File
}
```

#### `storage.read(offset, length, callback)`

Read a buffer from the storage.

#### `storage.stat(callback)`

Stat the storage to get the blob size.


## License

MIT

[blob]: https://developer.mozilla.org/en-US/docs/Web/API/Blob
[file]: https://developer.mozilla.org/en-US/docs/Web/API/File
[ras]: https://github.com/random-access-storage/random-access-storage

---
_Source: https://npm.io/package/random-access-blob · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
