JSPM

@rnd7/rum-temporary-storage

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q70087F
  • License MIT

Rumbullion Temporary Storage

Package Exports

  • @rnd7/rum-temporary-storage

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rnd7/rum-temporary-storage) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Rumbullion Temporary Storage

Temporary Storage Class used within the Rumbullion toolkit. Data stored will timeout after a given period of time when not changed or at least listed.

See also:

rum

rum-storage

Download

builds

Installation

npm i @rnd7/rum-temporary-storage

Include

Via script tag

<script src="node_modules/@rnd7/rum-temporary-storage/dist/rum-temporary-storage-browser.js"></script>

Using require

const TemporaryStorage = require('@rnd7/rum-temporary-storage').TemporaryStorage

Using import

import { TemporaryStorage } from '@rnd7/rum-temporary-storage'

Usage

let myStorage = new TemporaryStorage()
let sid = 'someStorageId'
myStorage.insert({sid, myProperty: "myValue"}).then(console.log)

API

Constructor

Pass optional configuration data as opts parameter assigned directly to the instance.

new TemporaryStorage(opts)

TemporaryStorage Defaults:

{
  scheduler: true,
  ttl: 1000*60*60*24,
  touchOnFind: true,
  touchOnList: true
}

You might also pass all Storage options.

Inherited from Storage.

insert(record)
list()
find(recordOrIndex)
update(record)
upsert(recordOrIndex)
replace(record)
remove(recordOrIndex)

get/set scheduler

The wipe procedure will be invoked automatically when true.

scheduler = true || false

schedule

Schedule a wipe manually.

schedule(time)

wipe

Wipe all outdated data manually. Usually not necessary.

wipe()

touch

Restart the ttl of the given record.

touch(recordOrIndex)

Development

Installation

Install dependencies such as rum-tester, rum-maker and rum-publisher

npm install

Build

Production build

npm run build

Test

Run Tests

npm test

Publish

Publish to github and npm using

npx publish-rum -m "My commit message"

License

See the LICENSE file for software license rights and limitations (MIT).