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

js-intel-store

v0.1.0

Published

Lightweight time-series + entity hybrid file storage engine. Five storage strategies (single_json / entity_json / entity_jsonl / append_jsonl / daily_jsonl) driven by a registry of declarative DataSourceSpec.

Readme

js-intel-store

A lightweight time-series + entity hybrid file storage engine. Five storage strategies (single_json / entity_json / entity_jsonl / append_jsonl / daily_jsonl) driven by a registry of declarative DataSourceSpec.

Zero runtime dependencies. ESM. Node >= 18.

Why

You want to persist app-generated data (snapshots, profiles, summaries, daily metrics) to plain files in a structured way, without dragging in a database. Each kind of data has different access patterns (one big doc, one file per entity, daily-rotated logs...). This library gives you those patterns as a small set of named strategies and lets you mix them under one engine.

Install

npm install js-intel-store

Or use a local file: dependency:

{
  "dependencies": {
    "js-intel-store": "file:../js-intel-store"
  }
}

Five-minute quickstart

import {
  DataSourceSpec,
  DataSourceRegistry,
  StorageEngine,
} from 'js-intel-store';

const registry = new DataSourceRegistry().registerAll([
  new DataSourceSpec({
    name: 'briefing',
    storageType: 'single_json',
    subdir: '',
    filename: 'briefing.json',
  }),
  new DataSourceSpec({
    name: 'agents',
    storageType: 'entity_json',
  }),
  new DataSourceSpec({
    name: 'feeds',
    storageType: 'daily_jsonl',
    retentionDays: 7,
    dedupKey: 'id',
  }),
]);

const engine = new StorageEngine({
  baseDir: './data',
  registry,
  timezone: 'Asia/Shanghai',
});

engine.ingest('briefing', { headline: 'hello' });
engine.ingest('agents', [{ name: 'alice', score: 12 }]);
engine.ingest('feeds', [{ id: 'p1', body: 'snap' }]);

engine.readSource('briefing');                 // { headline: 'hello', updated_at: ... }
engine.readSource('agents', { name: 'alice' });
engine.readSource('feeds', { days: 3 });
engine.dedupIds('feeds');                      // Set { 'p1' }
engine.cleanupAllSources();                    // { feeds: 2 } if 2 old files deleted

Architecture

                        StorageEngine
                              |
              +---------------+----------------+
              |               |                |
        DataSourceRegistry   ctx           strategies/
              |               |                |
        DataSourceSpec    timezone-aware    single_json
        (name + type +    now/today/...     entity_json
         subdir/filename                    entity_jsonl
         /retention/                        append_jsonl
         dedupKey)                          daily_jsonl

The engine is a thin router: it resolves spec by name, computes the on-disk path from spec metadata, builds a StrategyContext, and dispatches to the strategy module. Each strategy file owns one storage pattern and nothing else.

Storage strategies

| storageType | layout | use for | |----------------|-------------------------------------|----------------------------------| | single_json | one JSON file | global summaries, latest state | | entity_json | one JSON file per entity (by name) | profile registries, leaderboards | | entity_jsonl | one JSONL file per entity id | per-entity append logs (comments)| | append_jsonl | one growing JSONL file | event log, experiment journal | | daily_jsonl | one JSONL per day, with retention | snapshots, mentions, time series |

See docs/STRATEGIES.md for field-level details, examples, and the exact ingest() / read() / cleanup() semantics of each.

Documentation

Demo

npm run demo

Testing

npm test

46 unit tests covering spec validation, all 5 strategies, and engine dispatch.

License

MIT