This package has been deprecated

Author message:

Versions published prior to open sourcing are no longer supported

@dxos/random-access-multi-storage
TypeScript icon, indicating that this package has built-in type declarations

2.33.8 • Public • Published

Random Access Multi Storage

Build Status js-semistandard-style standard-readme compliant

Factory for creating platform-specific random-access-storage files.

Install

$ npm install @dxos/random-access-multi-storage

Usage

import { createStorage } from '@dxos/random-access-multi-storage';

const storage = createStorage('./dir');

const file = storage('test.txt')
file.write(0, Buffer('hello'), err => {
  file.read(0, 5, (err, data) => {
    console.log(data.toString())
  })
});

API

createStorage(rootPath: String, storageType?: StorageType) => RandomAccessStorage

Create a RandomAccessStorage based in the storageType. If storageType is not specified, return a default RandomAccessStorage depending on the environment.

  • rootPath: Root path to store the files.
  • storageType: Storage type.

Available storages:

import { StorageType, ... } from '@dxos/random-access-multi-storage'

Contributing

PRs accepted.

License

GPL-3.0 © dxos

Dependencies (6)

Dev Dependencies (11)

Package Sidebar

Install

npm i @dxos/random-access-multi-storage

Weekly Downloads

5

Version

2.33.8

License

MIT

Unpacked Size

4.66 MB

Total Files

107

Last publish

Collaborators

  • zhenya-dxos
  • mykola-vrmchk
  • dxos-bot
  • richburdon
  • marik_d
  • wittjosiah