js-cookie
cookies.js
Our great sponsors
js-cookie | cookies.js | |
---|---|---|
21 | 1 | |
21,545 | 2,379 | |
0.7% | - | |
7.7 | 0.0 | |
20 days ago | almost 5 years ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
js-cookie
-
Coding Authentication? Stop now and let Choreo manage it.
Once the user is logged in, you may need to access information like the user's name, email, etc. Choreo sends this information encoded in a cookie (named userinfo) upon successful login. We can extract the information using a cookie parsing library. For this example, we will be using js-cookie library.
-
Rust For JavaScript Developers Ltd. Received a Cease and Desist From Oracle Due to JavaScript Trademark
Interesting thread. If oracle were to send a cease and desist to everyone that uses "javascript" I would have received one years ago: https://github.com/js-cookie/js-cookie
-
Saving users’ preferences in SvelteKit
So something like this... (I’ll be using this package to simplify the code)
-
I'm giving out microgrants to open source projects for the third year in a row! Brag about your projects here so I can see them, big or small!
I created js-cookie with Klaus as we're planning to do something similar, but by leveraging crypto gains and leaving the money in a wallet to hopefully accrue some value over time and maximize the impact in other Open Source projects in the future.
-
Storing Login Information With Cookies (JavaScript)
There is an npm package we can use called js-cookie(or, alternatively, you can use a script tag to import it from jsDelivr CDN. Use this link for more info on how to install it.)
-
Which library to use to store tokens in cookies?
We use vuex-persisted state for session storage. We use https://github.com/js-cookie/js-cookie to set the auth cookie and then we have a getter in our store that checks the cookie token for validity for isLoggedIn
cookies.js
-
DDD Is Overrated
Sure you might not be able to write 100% of the documentation in one go and then the code, but AFAIK that's neither the goal or the intention of DDD, it's more like "document a bit, write a bit, repeat".
The way I do it is first write a draft of the documentation, of how I want the API to look like. Then check if that basic code is possible (which I can predict most of the times based on experience), then write some more docs or methods. When writing a lib I normally already know where I want to use it, so I can put example snippets from how I want to use it as the documentation first and then try to implement those methods.
Examples of libraries I've written mostly this way:
- https://github.com/franciscop/brownies
What are some alternatives?
vue-cookies - A simple Vue.js plugin for handling browser cookies
jquery-cookie
localForage - 💾 Offline storage, improved. Wraps IndexedDB, WebSQL, or localStorage using a simple but powerful API.
klaro-js - Klaro Privacy Manager. An open-source, privacy-friendly & compliant consent manager for your website.
lockr - A minimal API wrapper for localStorage
PouchDB - :koala: - PouchDB is a pocket-sized database.
vuex-persistedstate - 💾 Persist and rehydrate your Vuex state between page reloads.
store.js - Cross-browser storage for all use cases, used across the web.
WatermelonDB - 🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
basil.js - The missing Javascript smart persistent layer