All Projects → aykutkardas → lookie

aykutkardas / lookie

Licence: MIT license
Store your data in localStorage with optional expiration time. Almost like a cookie.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to lookie

svelte-persistent-store
A Svelte store that keep its value through pages and reloads
Stars: ✭ 111 (+42.31%)
Mutual labels:  cookie, localstorage
storm
🌐⚡️LocalStorage manager library for JavaScript
Stars: ✭ 14 (-82.05%)
Mutual labels:  localstorage, localstorage-api
phaser-super-storage
A cross platform storage plugin for Phaser
Stars: ✭ 49 (-37.18%)
Mutual labels:  cookie, localstorage
Client-Storage
🗄 Bulletproof persistent Client storage, works with disabled Cookies and/or localStorage
Stars: ✭ 15 (-80.77%)
Mutual labels:  cookie, localstorage
Vue Warehouse
A Cross-browser storage for Vue.js and Nuxt.js, with plugins support and easy extensibility based on Store.js.
Stars: ✭ 161 (+106.41%)
Mutual labels:  cookie, localstorage
Angular Local Storage
An AngularJS module that gives you access to the browsers local storage with cookie fallback
Stars: ✭ 2,862 (+3569.23%)
Mutual labels:  cookie, localstorage
localstorage-slim
An ultra slim localstorage wrapper with optional support for ttl and encryption
Stars: ✭ 47 (-39.74%)
Mutual labels:  localstorage, localstorage-api
Proxy Storage
Provides an adapter for storage mechanisms (cookies, localStorage, sessionStorage, memoryStorage) and implements the Web Storage interface
Stars: ✭ 10 (-87.18%)
Mutual labels:  cookie, localstorage
Brownies
🍫 Tastier cookies, local, session, and db storage in a tiny package. Includes subscribe() events for changes.
Stars: ✭ 2,386 (+2958.97%)
Mutual labels:  cookie, localstorage
elm-storage
Unified interface for accessing and modifying LocalStorage, SessionStorage and Cookies
Stars: ✭ 13 (-83.33%)
Mutual labels:  cookie, localstorage
beautifulscraper
Python web-scraping library that wraps urllib2 and BeautifulSoup
Stars: ✭ 40 (-48.72%)
Mutual labels:  cookie
localstorage-manager
LocalStorage Manager is a Chrome extension to add, edit, remove, export and import local storage and session storage data
Stars: ✭ 37 (-52.56%)
Mutual labels:  localstorage
cookies
Manage your cookies on client and server side (Angular Universal)
Stars: ✭ 40 (-48.72%)
Mutual labels:  cookie
cookiet
A small, simple JavaScript cookies library.
Stars: ✭ 13 (-83.33%)
Mutual labels:  cookie
client-persist
Offline storage for your web client. Supports IndexedDB, WebSQL, localStorage and sessionStorage with an easy to crawl with API.
Stars: ✭ 14 (-82.05%)
Mutual labels:  localstorage
Materialstartpage
Save your favorite sites with stylish using Local Storage
Stars: ✭ 12 (-84.62%)
Mutual labels:  localstorage
macaroons-rs
Macaroons: bearer credentials with caveats for distributed authorization
Stars: ✭ 62 (-20.51%)
Mutual labels:  cookie
F5-BIGIP-Decoder
Detecting and decoding BIGIP cookies in bash
Stars: ✭ 28 (-64.1%)
Mutual labels:  cookie
kurimudb
⚓ 足够简单的前端存储解决方案
Stars: ✭ 213 (+173.08%)
Mutual labels:  localstorage
wbp4j
Simple Java Api for 微博图床,使用简单的api即可完成上传图片
Stars: ✭ 48 (-38.46%)
Mutual labels:  cookie

npm Build Status License

Lookie

You can store your data in LocalStorage without converting it to string. You can specify how long this data will be stored in LocalStorage. Lookie is a small package without dependencies and has type support.

Install

npm install lookie
yarn add lookie

Usage

Import

import lookie from "lookie";

Set

Type conversions are handled automatically.

So you can give values such as array, object, boolean, number, null or string.

lookie.set("list", [1, 2, 3, 4]);

lookie.set("data", { key: "value" });

lookie.set("count", 1234);

lookie.set("muted", true);

lookie.set("theme", "dark");

lookie.set("user", null);

Set with Expiry

lookie.set("key", value, "1M 15D 20h"); // 1 month 15 days 20 hours

According to this example, when you want to get this data 1 month 15 days 20 hours after setting, it will be deleted and you will not be able to access it.

Multiple Set

lookie.setAll({ key: value, otherKey: otherValue });

Multiple Set with Expiry

lookie.setAll({ key: value, otherKey: otherValue }, "1M 15D 20h");

Get

lookie.get("key");

Remove

lookie.remove("key");

Sync

Data is checked only when called and deleted if it has expired. Therefore, even if they have expired, they will continue to be stored until you call them. If you want LocalStorage to stay up to date, simply run this method.

Unless you have a special reason, you won't need it at all.

lookie.sync();

More Information About Expiry Support

Available Time Ranges

Key Name
Y Year
M Month
D Day
h Hour
m Minute
s Second

Examples

lookie.set("key", value, 1000); // 1 second

lookie.set("key", value, { s: 1 }); // 1 second

lookie.set("key", value, "1s"); // 1second
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].