resolve-snapshot-lite

0.23.2 • Public • Published

resolve-snapshot-lite

npm version

This package is an adapter for storing snapshots using a file or memory. It does not have binary dependencies and does not require additional applications (like MongoDB or SQL server).

Available Parameters

  • bucketSize - the bucket size.
  • databaseFile - the path to a file where snapshots are stored. Notice, if that argument is not passed the adapter uses memory to store snapshots. In this case, all data is lost when an application instance is restarted.

Usage

import createSnapshotAdapter from 'resolve-snapshot-lite'

const snapshotAdapter = createSnapshotAdapter({
  databaseFile: 'path/to/file',
  bucketSize: 100
})

await snapshotAdapter.loadSnapshot(key)
await snapshotAdapter.saveSnapshot(key, value)
await snapshotAdapter.dispose({ dropSnapshots: true })

Analytics

Package Sidebar

Install

npm i resolve-snapshot-lite

Weekly Downloads

98

Version

0.23.2

License

MIT

Unpacked Size

37.3 kB

Total Files

6

Last publish

Collaborators

  • resolve-admin
  • reimagined-admin
  • vladihost
  • lykoi18