npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

chas-storage

v0.1.2

Published

Cross-browser key-value store database.

Readme

chasStorage

Cross-browser key-value store database.

chasStorage is a lightweight replacement of jStorage that also contain some additional features.

Install

Download chasStorage.js

Usage (basic API)

Attention: You must call chasStorage.load() manually!

getItem(name[, defaultValue])

Get value from storage

  • name - the name of the value
  • [defaultValue] - the defaultValue (if value not in storage). Default: null

Returns: value, if found, else defaultValue

chasStorage.getItem('foo.bar.baz')
chasStorage.getItem(7577, 'lorem ipsum')

setItem(name, value[, allowRewrite])

Store value in storage

  • name - the name of the value
  • value - value itself
  • [allowRewrite] - flag: is rewrite is allowed (i.e. if value is already in storage then it won't be changed). Default: true

Returns: is value setted (if allowRewrite == true, always true)

chasStorage.setItem('foo', 56)
chasStorage.setItem('unique value', 'ipsum lorem', false)

delete(name)

Remove value form storage

  • name - the name of the value

Returns: is value were exist

chasStorage.delete('foo')

contains(name)

Check is value in storage

  • name - the name of the value

Returns: does storage contain value?

if (chasStorage.contains('foo')) {
	console.log('key "foo" exists');
}

clear([flush])

Remove all items from storage

NOTE: It ignore autoFlush-flag

  • flush - flag to flush after clear. Default: false
chasStorage.clear();

load()

Load data

chasStorage.load();

flush()

Save data

chasStorage.flush();

autoFlush

Flag of autoFlush-mode: Call chasStorage.flush() after every change.

Default: false

storage

Contents of storage.

available

READONLY

Is chasStorage available.

Usage of domData-extension

Attention: domData is not depended on basic API of chasStorage

Using this extension you can save state of elements (of whole page or concrete DOM element) to storage.

domData handling every element with attribute data-chasstorage-id (you can change this name via domData.idAttriubte).

In data-chasstorage-id stored id of this element's record. In optional attribute data-chasstorage-conf you can specify things must be saved.

Syntax of data-chasstorage-conf

Those words with ! means exclude, else include:

  • value - value of element (only for inputs)
  • checked - is checkbox checked (only for checkboxes)
  • innerHtml - innerHtml of DOM element
  • visible - is style.display != 'none'

Also you can exclude every thing by default with !*.

Priority of lexems:

  1. !lexem
  2. lexem
  3. !*

domData.idAttribute

ID attribute

Default: data-chasstorage-id

domData.confAttribute

Configuration attribute

Default: data-chasstorage-conf

domData.load([domElement])

Load values to elements of domElement

  • [domElement] - element of DOM. Default: document
chasStorage.domData.load()
chasStorage.domData.load(document.getElementById('text-areas'))

domData.save([domElement])

Save values of elements of domElement

  • [domElement] - element of DOM. Default: document
chasStorage.domData.save()
chasStorage.domData.save(document.getElementById('some-id'))

License

Unlicense