# random-access-idb-mutable-file

> random-access-storage provider via non-standard IDBMutableFile API

Latest version **0.3.0** (published 2019-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install random-access-idb-mutable-file
pnpm add random-access-idb-mutable-file
yarn add random-access-idb-mutable-file
bun add random-access-idb-mutable-file
```

## 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.3.0 |
| Published | 2019-06-07 |
| First published | 2018-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 183.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Irakli Gozalishvili |
| Maintainers | gozala |
| Keywords | random-access-idb-mutable-file, typed, flow |

## Links

- npm: https://www.npmjs.com/package/random-access-idb-mutable-file
- Repository: https://github.com/Gozala/random-access-idb-mutable-file
- npm.io page: https://npm.io/package/random-access-idb-mutable-file

## Dependencies (2)

- [buffer](https://npm.io/package/buffer.md) 5.1.0
- [random-access-storage](https://npm.io/package/random-access-storage.md) 1.3.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2019-06-07
- 0.2.0 — 2019-06-06
- 0.1.0 — 2018-06-25

## README

# random-access-idb-mutable-file

[![travis][travis.icon]][travis.url]
[![package][version.icon] ![downloads][downloads.icon]][package.url]
[![styled with prettier][prettier.icon]][prettier.url]

[random-access][random-access-storage] storage layer over [IDBMutableFile][], which is **non-standard** IndexedDB extension in Gecko to provide virtual file system API with-in the IndexedDB.

This library will only work in Firefox (unless other browsers implement [IDBMutableFile][] API) and it's mostly targeted at [WebExtensions][]. It mostly amis to be a drop-in replacement for [random-access-file][]. It is also an alternative to [random-access-idb][] that is able to avoid loading all of the file content for random read / writes at the expanse of limited runtime suport.

## Usage

```js
import RandomAccess from "random-access-idb-mutable-file"

const main = async (filename, options) => {
  const randomAccessFile = await RandomAccess.mount()

  const file = randomAccessFile(filename, options)
  file.write(10, Buffer.from("hello"), error => {
    // write a buffer to offset 10
    file.read(10, 5, (error, buffer) => {
      console.log(buffer) // read 5 bytes from offset 10
      file.close(() => {
        console.log("file is closed")
      })
    })
  })
}
```

## Install

    npm install random-access-idb-mutable-file

[travis.icon]: https://travis-ci.org/Gozala/random-access-idb-mutable-file.svg?branch=master
[travis.url]: https://travis-ci.org/Gozala/random-access-idb-mutable-file
[version.icon]: https://img.shields.io/npm/v/random-access-idb-mutable-file.svg
[package.url]: https://npmjs.org/package/random-access-idb-mutable-file
[downloads.icon]: https://img.shields.io/npm/dm/random-access-idb-mutable-file.svg
[downloads.url]: https://npmjs.org/package/random-access-idb-mutable-file
[prettier.icon]: https://img.shields.io/badge/styled_with-prettier-ff69b4.svg
[prettier.url]: https://github.com/prettier/prettier
[random-access-storage]: https://github.com/random-access-storage/random-access-storage
[random-access-file]: https://github.com/random-access-storage/random-access-file
[idbmutablefile]: https://developer.mozilla.org/en-US/docs/Web/API/IDBMutableFile
[webextensions]: https://developer.mozilla.org/en-US/Add-ons/WebExtensions
[random-access-idb]: https://github.com/random-access-storage/random-access-idb

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