Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Readme
Kizzy is a light-weight, cross-browser, JavaScript local storage utility. It leverages the HTML5 localStorage API when available, as well as Internet Explorer's persistent XML store — wrapped up in a easy to use, memcached-like interface. When neither of these features are available (unlikely), it falls back to an in-browser object store.
It looks like this
var cache = kizzy('users')
var agent = cache.get('Agent')
if (agent) {
alert('Welcome back ' + agent.name)
} else {
cache.set('Agent', {
name: 'Agent Diaz'
})
}
Furthermore, a call to 'set' will return the value, making it quite easy for assignment.
var cache = kizzy('users')
var agent = cache.get('Agent') || cache.set('Agent', {
name: 'Agent Diaz'
})
Lastly, you can pass an optional third argument to 'set' that tells the cache how long to live
var cache = kizzy('users')
var agent = cache.get('Agent') || cache.set('Agent', {
name: 'Agent Diaz'
}, 5000) // time to live set for 5 seconds
// wait 3 seconds...
setTimeout(function() {
alert('Still there ' + cache.get('Agent').name)
}, 3000)
// 6 seconds later...
setTimeout(function() {
cache.get('Agent').name // => expired
}, 6000)
$ submodule update --init
& make
Tests will not currently pass if run on a file:/// protocol. Otherwise...
$ open tests/test.html
Install Kizzy as an Ender module
$ ender add kizzy
Use it as such:
$.cache('user').get('name')
The name comes from Kunta Kinte, a Mandinka African warrior from the 1700's. After being brought into slavery, he had a daughter whom he named Kizzy, which translates to stay put in hopes that the family would stay together, but not stay a slave.
Happy Caching!
FAQs
x-browser LocalStorage API with a memcached interface
The npm package kizzy receives a total of 5 weekly downloads. As such, kizzy popularity was classified as not popular.
We found that kizzy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.