crumbsjs alternatives and similar libraries
Based on the "Storage" category.
Alternatively, view crumbsjs alternatives based on common mentions on social networks and blogs.
-
js-cookie
A simple, lightweight JavaScript API for handling browser cookies -
localForage
๐พ Offline storage, improved. Wraps IndexedDB, WebSQL, or localStorage using a simple but powerful API. -
jquery-cookie
A simple, lightweight jQuery plugin for reading, writing and deleting cookies. -
store.js
Cross-browser storage for all use cases, used across the web. -
NeDB
The JavaScript Database, for Node.js, nw.js, electron and the browser -
WatermelonDB
๐ Reactive & asynchronous database for powerful React and React Native apps โก๏ธ -
Lovefield
Lovefield is a relational database for web apps. Written in JavaScript, works cross-browser. Provides SQL-like APIs that are fast, safe, and easy to use. -
basket.js
A script and resource loader for caching & loading files with localStorage -
cookies.js
๐ซ Tastier cookies, local, session, and db storage in a tiny package. Includes subscribe() events for changes. -
jStorage
jStorage is a simple key/value database to store data on browser side -
DB.js
db.js is a wrapper for IndexedDB to make it easier to work against -
awesome-web-storage
:sunglasses: Everything you need to know about Client-side Storage. -
Hadmean
Generate powerful admin apps in seconds with just `npx hadmean`. Stop building and maintaining admin apps that you can auto-generate. -
datavore
A small, fast, in-browser database engine written in JavaScript. -
proxy-web-storage
Keep the type of storage value unchanged and change array and object directly. Supports listening to the changes and setting expires. -
JSON ODM
A JSON ODM (object document mapper) for JavaScript to use on the server or in the browser.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of crumbsjs or a related project?
README
๐ช CrumbsJS ๐ช
A lightweight, intuitive, vanilla ES6 fueled JS cookie and local storage library.
Quick Start
Adding a single cookie or a local storage key
// Cookie
crumbs.set("Operating System","Win10"); // => true
// Local storage key
crumbs.ls.set("Operating System","Win10") // => true
Adding a single cookie that will expire in 7 days for a specific path
// The "expires" parameter is capable of taking a number, and will default as days.
crumbs.set("Name","Roy Azaeev",{type:"day",value:7},"/crumbsjs"); // => true
Adding a few cookies at once
const my_cookies = [];
my_cookies.push({name:"Operating System",value:"Win10"});
my_cookies.push({name:"Age",value:"29"});
crumbs.set(my_cookies); // => [{name:"Operating System",value:"Win10"},{name:"Age",value:"29"}]
Adding a few local storage keys at once
const my_localstorage_array = [];
my_localstorage_array.push({"key":"Operating System","value":"Win10"});
my_localstorage_array.push({"key":"Age","value":"29"});
crumbs.set(my_localstorage_array); // => [{key:"Operating System",value:"Win10"},{key:"Age",value:"29"}]
Get a cookie or a local storage key value
// Cookie
let age = crumbs.get("Age"); // => "29"
// Local storage
let age = crumbs.ls.get("Age"); // => "29"
Get all cookies or all local storage keys in a key-value pair object
// Cookies
let all_cookies = crumbs.getAll(); // => [{name:"Operating System",value:"Win10"},{name:"Age",value:"29"}]
// Local storage
let all_localstorage = crumbs.ls.getAll(); // => [{key:"Operating System",value:"Win10"},{key:"Age",value:"29"}]
Delete a single cookie or local storage key
// Cookie
crumbs.delete("Operating system"); // => true
// Local storage
crumbs.ls.delete("Operating system"); // => true
Delete a few cookies at once
const my_cookies = [];
my_cookies.push("Operating system");
my_cookies.push("Age");
crumbs.delete(my_cookies); // => true
Features
- NO DEPENDENCIES - Yup, no jQuery.
- ES5 compatible.
- Tested, using Jest.
- Add one or multiple cookies or local storage keys at once
- Update cookies or local storage keys using the
set
method - Delete one or multiple cookies at once
- Delete local storage keys easily
- Display a cookie or a local storage key value
- Display all cookies or local storage keys in a key-value easy to read object
- Fallback to cookies when localstorage is not available (Safari private browsing)
Methods
set(name, value, [expires], [domain])
Sets one or more cookies or local storage keys.
name can be set as an array of key-pair objects in the format of {name:"Age",value:29} for mass cookie set
get(name)
Gets a cookie or a local storage value by its name.
getAll()
Gets all the cookies or local storage keys in a key-pair object array.
delete(name)
Deletes a cookie or local storage key by its name.
name can be set as an array of strings for mass delete of cookies
deleteAll()
Deletes all cookies or local storage keys.
Getting Started
Install On your local PC
Using a bundler ?
You can import CrumbsJS like that
import crumbs from 'crumbsjs';
Download Sources
use npm
npm install crumbsjs
use git
git clone https://github.com/nirtz89/crumbsjs.git
What's next
- IndexDB support
- Session storage support
Contributers
Thank you for making the library better!