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

@liquicode/jsonstor

v0.2.0

Published

A centralized MongoDB-style interface to work with a variety of database products and platforms.

Readme

@liquicode/jsonstor

Home: http://jsonstor.liquicode.com

Version: 0.2.0

WARNING:

Please review breaking changes in the Version History before replacing and upgrading.

One storage interface for many databases.

Overview

jsonstor gives every storage the same interface, modeled on MongoDB's: the same functions, the same queries, and the same results, whether the documents are in memory, in a file, or in a database server. An adapter connects the interface to one product.

const jsonstor = require( '@liquicode/jsonstor' )();

let storage = jsonstor.GetStorage( 'jsonstor-memory' );
await storage.InsertOne( { name: 'Alice', role: 'admin' } );
let admins = await storage.FindMany( { role: 'admin' } );

Start with jsonstor-memory or jsonstor-jsonfile, and change to jsonstor-mongodb, jsonstor-postgres or another adapter later without changing the code which uses the storage.

Features

  • One interface, and one set of MongoDB-style query, projection and update operators, for every adapter.
  • Every storage function is async.
  • Pure Javascript. Installing @liquicode/jsonstor installs only @liquicode/jsongin.
  • Each external adapter is a separate package, so you install only the drivers you use.
  • Add your own adapters and filters.

Storage Interface

  • DropStorage( Options ) : Deletes the storage.
  • FlushStorage( Options ) : Writes any cached changes to the storage.
  • Count( Criteria, Options ) : Returns the number of documents matching Criteria.
  • InsertOne( Document, Options ) : Inserts one document.
  • InsertMany( Documents, Options ) : Inserts several documents.
  • FindOne( Criteria, Projection, Options ) : Returns the first document matching Criteria.
  • FindMany( Criteria, Projection, Options ) : Returns every document matching Criteria.
  • FindMany2( Criteria, Projection, Sort, Paging, Options ) : Returns the documents matching Criteria, sorted and paged. Paging is a MaxCount number or { SkipCount, MaxCount }.
  • UpdateOne( Criteria, Updates, Options ) : Applies Updates to the first document matching Criteria.
  • UpdateMany( Criteria, Updates, Options ) : Applies Updates to every document matching Criteria.
  • ReplaceOne( Criteria, Document, Options ) : Replaces the first document matching Criteria.
  • DeleteOne( Criteria, Options ) : Deletes the first document matching Criteria.
  • DeleteMany( Criteria, Options ) : Deletes every document matching Criteria.
  • StorageInfo( Options ) : Describes the product, version and identifier of the storage.
  • RefreshIndex( Options ) : Rebuilds an adapter's identifier index after something else changed the store.

See the Storage Interface.

Query, Projection, and Update Operators

Criteria, projections and updates are evaluated by jsongin, so a storage supports the operators jsongin supports. See the jsongin Operator Reference.

Every adapter returns the same documents for the same criteria. An adapter for a database translates what that database can express into its own query, and jsongin checks the results against the whole criteria. An operator the database cannot express still works; it just makes the database return more rows. See the Translation Layer.

Storage Adapters

jsonstor-memory, jsonstor-jsonfile and jsonstor-folder are built in. Every other adapter is a separate package.

See Storage Adapters for the list, and Storage Invariants for the rules every adapter follows.

Storage Filters

A filter wraps a storage and has the same interface, so a filtered storage is used like any other. Filters can be stacked.

  • jsonstor-oplog : Logs each storage call.
  • jsonstor-userinfo : Adds document ownership, permissions and sharing.

See Storage Filters.

Documentation and Tests

The documentation and tests for jsonstor and every adapter are in jsonstor-docs, which is not published to npm. One site, http://jsonstor.liquicode.com, covers them all. See the Test Results.