2.0.0 • Published 2 years ago

random-access-web-storage v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

random-access-web-storage

Exposes the same interface as random-access-file but instead of writing/reading data to a file it writes to any Web Storage API compatible database.

npm install random-access-web-storage

Usage

import RAWS from 'random-access-web-storage';

// Create random access web storage using a Web Storage instance
const raws = RAWS(localStorage);

var file = raws(filename);

file.write(0, Buffer.from('hello'), function () {
  file.write(5, Buffer.from(' world'), function () {
    file.read(0, 11, console.log); // returns Buffer(hello world)
  });
});

License

MIT

2.0.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago