SkillAgentSearch skills...

Histore

🏬 200b key-value store backed by navigation state

Install / Use

/learn @developit/Histore
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<p align="center"> <img src="https://i.imgur.com/zN9xe7D.png" width="300" height="300" alt="histore"> <h1 align="center"> Histore <a href="https://www.npmjs.org/package/histore"><img src="https://img.shields.io/npm/v/histore.svg?style=flat" alt="npm"></a> </h1> </p>

Histore [hisΒ·toΒ·ry]: a 200b key-value store backed by navigation state.

Does the fact that sessionStorage/localStorage is shared across tabs have you down?

Don't worry, here's a strange but widely supported way to store 640kb of object data in a page's navigation state.

View Demo on JSFiddle

Usage

import histore from 'histore'

let storage = histore()

storage.set('foo', 'bar')
storage.get('foo')  // 'bar'

storage.set('obj', { any: 'object' })
storage.get('obj').any  // 'object'

Interestingly, due to the way history.replaceState works, storing objects will implicitly clone them using the Structured Clone algorithm.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Changelog

Every release, along with the migration instructions, is documented on the Github Releases page.

License

Apache 2.0

View on GitHub
GitHub Stars674
CategoryData
Updated1mo ago
Forks19

Languages

JavaScript

Security Score

100/100

Audited on Feb 18, 2026

No findings