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 🙏

© 2025 – Pkg Stats / Ryan Hefner

stower

v2.1.0

Published

Simple disk backed key/value store for node

Readme

stower

license Tests npm

Stower is a simple disk backed key/value store for node.

Why? because sometimes you just need to stow a few values, no database, no fuss. stower keeps your data in memory and writes it to disk as a readable JSON file in the background. It handles atomic saves, uses file locks to avoid conflicts, recovers from corrupt files, and stores everything in your systems cache folder (when no path provided).

Install

npm install stower

Usage

var stower = require('stower');

// persist (optional JSON file path)
stower.persist('./stow.json');

// enable debugging (console logs)
stower.debug = true;

// store some data
stower.set('token', { id: '123', key: 'abc' });

// retrieve it
var token = stower.get('token');

// check it exists
if (stower.exists('token')) {
    console.log('token exists');
}

// remove it
stower.remove('token');

// view all keys
console.log(stower.keys());

// view all values
console.log(stower.values());

// get the JSON file name and path
console.log(stower.filename);

// clear everything
stower.clear();

Properties

Property | Description :----------|:--------------------------------------------- filename | Returns filename used so store data on disk debug | Get/set debug status (enables console logs)

Methods

Method | Description :-------------------|:------------------------------------------------------------------------------------- get(key) | Retrieves a value by key, returns null if the key doesn't exist set(key, value) | Stores a value and schedules it to be saved to disk remove(key) | Deletes a key from the store and schedules the update to disk exists(key, val) | Checks if a key exists and optionally if it matches a given value using deep equality keys() | Returns an array of all stored keys values() | Returns an array of all stored values clear() | Deletes all stored data and schedules a save to disk persist(filename) | Loads previously saved values from disk and auto saves changes (optional filename)

Note: if persist() is not called, values only exist in memory.

Contributing

As always, pull requests are welcomed - but please ensure you provide a test where necesssary.

Tests

You can run the tests using npm test

Star

If you find this useful please star the repo, it helps us prioritise Open Source work.

History

For change-log, check releases.

License

MIT License © Orca Scan - a barcode app with simple barcode tracking APIs.

TODO