IndexedDB Stream
Use node.js streams to read from / write to an IndexedDB.
How to use
First install with npm
or yarn
:
npm install --save indexed-db-streamyarn install --save indexed-db-stream
Use this library in your JavaScript or TypeScript project:
JavaScript
const indexedDbStream = ; // Keep in mind that you have to create your database first on the "onupgradeneeded" event!const writer = databaseName: 'myDatabase' databaseVersion: 1 // optional objectStoreName: 'myStore'; writer;writer;// ...writer; // -- same for the reader -- const reader = databaseName: 'myDatabase' databaseVersion: 1 // optional objectStoreName: 'myStore' indexName: 'myIndex' // optional cursorDirection: 'next' // optional; reader;reader;reader;
TypeScript
// Keep in mind that you have to create your database first on the "onupgradeneeded" event!; writer.write;writer.write;// ...writer.end; // -- same for the reader -- ; reader.pipe/* ... */;reader.on"data",;reader.on"end",;
NPM Tasks
npm run doc
: Create an API documentation withtypedoc
.npm run browser-test
: Create a test that you can run in your browser (target:browser-test/index.html
).npm test
: Run tests withkarma
automated in several browsers and create a coverage-report.
Contribution
Make an issue on GitHub, or even better a pull request and try to fulfill the software tests.
License
This library is under ISC License © by Arne Schubert.