All Projects → tiaanduplessis → stoor

tiaanduplessis / stoor

Licence: MIT license
Storage wrapper with support for namespacing, timeouts and multi get/set and remove.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to stoor

vue-web-storage
Vue.js plugin for local storage and session storage (1.8 kb min+gz) 💾
Stars: ✭ 85 (+226.92%)
Mutual labels:  storage, localstorage, sessionstorage
Angular Locker
🗄️ A simple & configurable abstraction for local/session storage in angular js projects
Stars: ✭ 318 (+1123.08%)
Mutual labels:  storage, localstorage, sessionstorage
persistence
💾 Persistence provides a pretty easy API to handle Storage's implementations.
Stars: ✭ 18 (-30.77%)
Mutual labels:  storage, localstorage, sessionstorage
Brownies
🍫 Tastier cookies, local, session, and db storage in a tiny package. Includes subscribe() events for changes.
Stars: ✭ 2,386 (+9076.92%)
Mutual labels:  storage, localstorage, sessionstorage
Recoil Persist
Package for recoil state manager to persist and rehydrate store
Stars: ✭ 66 (+153.85%)
Mutual labels:  storage, localstorage, sessionstorage
Vue Ls
💥 Vue plugin for work with local storage, session storage and memory storage from Vue context
Stars: ✭ 468 (+1700%)
Mutual labels:  storage, localstorage, sessionstorage
Immortaldb
🔩 A relentless key-value store for the browser.
Stars: ✭ 2,962 (+11292.31%)
Mutual labels:  storage, localstorage, sessionstorage
h5webstorage
Web Storage for Angular 2
Stars: ✭ 38 (+46.15%)
Mutual labels:  storage, localstorage, sessionstorage
ng2-storage
A local and session storage wrapper for angular 2.
Stars: ✭ 14 (-46.15%)
Mutual labels:  storage, localstorage, sessionstorage
Proxy Storage
Provides an adapter for storage mechanisms (cookies, localStorage, sessionStorage, memoryStorage) and implements the Web Storage interface
Stars: ✭ 10 (-61.54%)
Mutual labels:  storage, localstorage, sessionstorage
Store
A better way to use localStorage and sessionStorage
Stars: ✭ 1,646 (+6230.77%)
Mutual labels:  storage, localstorage, sessionstorage
React Storage Hooks
React hooks for persistent state
Stars: ✭ 146 (+461.54%)
Mutual labels:  storage, localstorage, sessionstorage
Depot.js
📦 depot.js is a storage library with a simple API
Stars: ✭ 247 (+850%)
Mutual labels:  storage, localstorage
MeowDB.js
Database in JSON (Node.JS Library)
Stars: ✭ 12 (-53.85%)
Mutual labels:  wrapper, storage
Rxfirebase
Rxjava 2.0 wrapper on Google's Android Firebase library.
Stars: ✭ 509 (+1857.69%)
Mutual labels:  wrapper, storage
Flutter localstorage
📦flutter localstorage for ios/android/desktop/web
Stars: ✭ 206 (+692.31%)
Mutual labels:  storage, localstorage
Jsstore
A complete IndexedDB wrapper with SQL like syntax.
Stars: ✭ 430 (+1553.85%)
Mutual labels:  wrapper, storage
Bus
Bus 是一个基础框架、服务套件,它基于Java8编写,参考、借鉴了大量已有框架、组件的设计,可以作为后端服务的开发基础中间件。代码简洁,架构清晰,非常适合学习使用。
Stars: ✭ 253 (+873.08%)
Mutual labels:  wrapper, storage
cache-bucket
Light Cache for nodeJs and browserJs with TTL.
Stars: ✭ 14 (-46.15%)
Mutual labels:  localstorage, sessionstorage
vue-storage-watcher
a reactive storage plugin for vue 👀🔭
Stars: ✭ 60 (+130.77%)
Mutual labels:  localstorage, sessionstorage

📦 stoor

package version package downloads standard-readme compliant package license make a pull request

Storage wrapper with support for namespacing, timeouts and multi get/set and remove.

👀 Background

This module is a small wrapper around the local and session storage.

Features

  • Parsing and stringification of values
  • Custom storage adaptor
  • Plugable fallback (defaults to in memory)
  • Namespacing
  • Multi get, set & remove of values
  • Expiring values

Install

⚙️ Install

Install the package locally within you project folder with your package manager:

With npm:

npm install stoor

With yarn:

yarn add stoor

With pnpm:

pnpm add stoor

📖 Usage

Kitchen sink

var things = new Stoor({ namespace: 'things' }) // Namespaced to things and uses local storage
var otherThings = new Stoor({ namespace: 'otherThings', storage: 'session' }) // Namespaced to other things and uses Session storage
things.set('foo', 1)
things.set('bar', 2)
things.set('baz', { foo: 4, baz: 4 })
console.log(things.get('baz')) // {foo: 4, baz: 4}
console.log(otherThings.get('baz')) // null
console.log(things.get(['foo', 'bar'])) // [1, 2]

things.remove(['foo', 'bar'])
console.log(things.get(['foo', 'bar'])) // [null, null]

otherThings.set([['bar', 5], ['foo', 6]]) // Array of key value pairs to multi set
console.log(otherThings.get(['foo', 'bar'])) // [6, 5]

otherThings.set('nana', 1, 5000) // Will expire within 5000 ms.
otherThings.get('nana', 3) // Returns default value if expired.

things.clear()

Custom storage

You can configure any module that conforms to the the localStorage/sessionStorage API to be the fallback or main method of storage.

For example using cookie-session-storage:

new Stoor({fallback: cookieSessionStorage})
new Stoor({storage: cookieSessionStorage})

📚 API

For all configuration options, please see the API docs.

💬 Contributing

Got an idea for a new feature? Found a bug? Contributions are welcome! Please open up an issue or make a pull request.

🪪 License

MIT © Tiaan du Plessis

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].