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

localio

v0.5.7

Published

A local Cloud-like API

Readme

LocalIO

LocalIO is a versatile library designed to simplify data storage directly within the end user's browser. It provides a straightforward API for handling local NoSQL databases, S3-compatible storage, and a time-to-live (TTL) cache.


Features

  1. Local NoSQL Database

    • Structured and queryable local database for your web application needs.
    • Use collections, documents, and advanced queries.
  2. Local S3-compatible Storage

    • Bucket-based storage for file-like data management.
  3. Local Cache with TTL

    • Fast and efficient cache storage with optional expiration times.
  4. Built on Top of Native Browser APIs

    • Utilizes IndexedDB, BucketManager, and CacheStorage for efficient storage and retrieval.

Installation

Install the package using npm:

npm install localio

API Usage

1. Bucket (Local S3-compatible Storage)

The Bucket API provides a straightforward way to store and retrieve file-like data.

Example:

import { openBucket } from 'localio';

// Initialize a bucket
const bucket = await openBucket('my-bucket');

// Store data
await bucket.put('path/to/key', 'value');

// Retrieve data
const data = await bucket.get('path/to/key'); // Returns null if the key is not found

2. Database (Local NoSQL Storage)

The Database API allows you to work with collections and documents, similar to a NoSQL database.

Example:

import { getDatabase } from 'localio';

// Initialize a database
const db = await getDatabase('my-database');

// Access a collection
const ref = await db.get('collection_name');

// Add or update a document
await ref.set('document_id', { field: 'value' });

// Query documents
const document = await ref.where('field', '==', 'value').limit(10).get();

3. Cache (Local Cache with TTL)

The Cache API provides fast in-memory storage with support for TTL (time-to-live) and options to preserve existing TTL values.

Example:

import { getCache } from 'localio';

// Initialize a cache
const cache = await getCache('my-cache');

// Store data with a TTL of 3600 seconds (1 hour)
cache.set('key', 'value', { ttl: 3600 });

// Retrieve data
const data = await cache.get('key');

// Update value while preserving existing TTL
await cache.set('key', 'newValue', { preserveTTL: true });

// Delete a key
cache.delete('key');

Why LocalIO?

  • Browser-native: No server is required for storage; all data resides locally.
  • Modular API: Use only the components you need (Bucket, Database, or Cache).
  • Ease of Use: Familiar APIs for storage, querying, and caching.
  • Performance: Optimized for fast read/write operations in modern browsers.

For more details, explore the official documentation or examples provided in the library.