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

@alt-javascript/jsnosqlc-core

v1.1.1

Published

JSNOSLQC core interfaces — Driver, Client, Collection, Cursor, Filter, DriverManager

Readme

@alt-javascript/jsnosqlc-core

Language npm version License: MIT CI

Core interfaces for the JSNOSLQC unified NoSQL access layer: Driver, Client, Collection, Cursor, Filter, FieldCondition, and DriverManager.

Part of the @alt-javascript/jsnosqlc monorepo.

Install

npm install @alt-javascript/jsnosqlc-core

Install a driver alongside core:

npm install @alt-javascript/jsnosqlc-core @alt-javascript/jsnosqlc-memory

Core API

DriverManager

Routes connection requests to the appropriate registered driver.

import { DriverManager } from '@alt-javascript/jsnosqlc-core';
import '@alt-javascript/jsnosqlc-mongodb'; // self-registers on import

const client = await DriverManager.getClient('jsnosqlc:mongodb://localhost:27017/mydb');

ClientDataSource

Convenience factory that mirrors the DataSource pattern from jsdbc.

import { ClientDataSource } from '@alt-javascript/jsnosqlc-core';
import '@alt-javascript/jsnosqlc-memory';

const ds = new ClientDataSource({ url: 'jsnosqlc:memory:' });
const client = await ds.getClient();

Client

Manages the session lifecycle and a collection cache.

const client = await DriverManager.getClient(url);

const users = client.getCollection('users'); // returns cached instance on repeat calls
console.log(client.isClosed()); // false

await client.close();

Collection

Six operations on a named collection.

const col = client.getCollection('products');

// Key-value operations
await col.store('sku-001', { name: 'Widget', price: 9.99 });
const doc = await col.get('sku-001');     // { name: 'Widget', price: 9.99 }
await col.delete('sku-001');

// Document operations (backend-assigned id)
const id = await col.insert({ name: 'Gadget', price: 24.99 });
await col.update(id, { price: 19.99 }); // patch — other fields preserved

// Query
const filter = Filter.where('price').lt(20).build();
const cursor = await col.find(filter);

Cursor

Supports both cursor iteration and bulk access, with async iterator support.

// Bulk access
const cursor = await col.find(filter);
const docs = cursor.getDocuments();

// Cursor iteration
while (await cursor.next()) {
  const doc = cursor.getDocument();
  console.log(doc);
}

// Async iterator
for await (const doc of cursor) {
  console.log(doc);
}

Filter

Chainable filter builder. Produces an AST consumed by driver translators.

import { Filter } from '@alt-javascript/jsnosqlc-core';

// Single condition
const f1 = Filter.where('status').eq('active').build();

// AND chain
const f2 = Filter.where('age').gt(18).and('country').eq('AU').build();

// OR compound (static factory — takes built AST nodes)
const f3 = Filter.or(
  Filter.where('status').eq('active').build(),
  Filter.where('status').eq('pending').build()
);

// NOT negation
const f4 = Filter.where('status').eq('inactive').not();

Filter Operators

| Operator | Example | Meaning | |---|---|---| | eq | .eq('Alice') | Equal | | ne | .ne('inactive') | Not equal | | gt | .gt(18) | Greater than | | gte | .gte(18) | Greater than or equal | | lt | .lt(100) | Less than | | lte | .lte(100) | Less than or equal | | contains | .contains('admin') | Array contains element, or string contains substring | | in | .in(['a', 'b']) | Field is one of the values | | nin | .nin(['x', 'y']) | Field is not one of the values | | exists | .exists(true) | Field is present (true) or absent (false) |

Writing a Driver

See the Driver Guide and @alt-javascript/jsnosqlc-memory for a complete minimal example.

Running Compliance Tests

The compliance suite is importable for third-party drivers:

import { runCompliance } from '@alt-javascript/jsnosqlc-core/test/driverCompliance.js';

runCompliance(async () => {
  const client = await DriverManager.getClient('jsnosqlc:mydriver:...');
  return client;
});

License

MIT