browser-store-test-data
Version:
A simple way to load test data for the browser store.
50 lines (41 loc) • 1.68 kB
Markdown

[](https://david-dm.org/eugene-the-red/browser-store-test-data)
[](https://packagephobia.com/result?p=browser-store-test-data)

A simple way to load test data into the browser store. Supports [IndexedDB](https://www.w3.org/TR/IndexedDB/).
Essentially when developing, you provide a file with some test data.
This test data is loaded into the browser store & ready before your application runs.
Your application then runs & reads test data from the browser store.
- [Installation](
- [Usage](
- [Webpack Plugin Usage](
- [Development](
```shell
npm i -D browser-store-test-data
```
The main intended method to use this in your project via webpack plugin.
```js
// load the library & add to plugins section with otions. Specify test data file(s)
const BrowserStoreTestDataPlugin = require('browser-store-test-data')
plugins: [
new BrowserStoreTestDataPlugin(
{
browserDatabase: '[browser-database-name]',
testData: [
{
collectionName: 'collection-name',
dataFile: '.path/to/file/dir'
}
]
}
)
]
```
(Unlicense) See https://unlicense.org