
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
@urbandoor/storage
Advanced tools
A library for returning a localStorage compatible API, regardless of browser
The type checked localStorage API you might have always been looking for.
The land of localStorage polyfill and replacements is a crowded place. Most of these are fantastic libraries, but none satisfied all the requirements that I wanted.
sessionStorage
and localStorage
Along the way I also noticed that polyfills for document.cookie
were
missing a few key features for cookies, such as cookies in the past not
being removed.
This library is far from perfect, but it meets all the criteria I need.
Installing through npm is done as one would normally expect:
$ npm install --save @urbandoor/storage
Usage in webpack/typescript works as follows:
import Storage from '@urbandoor/storage';
const storage = new Storage();
storage.setItem('potato', 'true');
storage.getItem('potato'); // 'true'
storage.length; // 1
storage.keys(0); // potato
storage.removeItem('potato');
storage.setItem('potato1', 'true');
storage.setItem('potato2', 'true');
storage.setItem('potato3', 'true');
storage.setItem('potato4', 'true');
storage.clear();
storage.getItem('potato1'); // null
FAQs
A library for returning a localStorage compatible API, regardless of browser
We found that @urbandoor/storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers 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
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.