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

@tatva-framework/core

v0.0.1

Published

<!-- packages/core/README.md --> # Core (packages/core)

Readme

Core (packages/core)

Lightweight building blocks used across this monorepo: small model base classes, adapters, filters and decorators for declaring entity metadata.

Key pieces

  • Decorators: Entity, Ignore, Key (see src/decorators/*).
  • Models & types: BaseModel, BaseAdapter, BaseFilters, SaveInstruction (see src/models/*).
  • Entry point: src/index.ts exports the package public API.

The package aims to be minimal and framework-agnostic — provide simple contracts and helpers so other packages in the workspace can implement adapters and models consistently.

Quick Example

Below is a small example showing how to define a model with the decorators and a tiny in-memory adapter that implements the BaseAdapter contract. This demonstrates basic save/find behavior.

// Example: define a model and an in-memory adapter
import { Entity } from './decorators/entity_decorator';
import { Key } from './decorators/key_decorator';
import { Ignore } from './decorators/ignore_decorator';
import { BaseModel } from './models/base_model';
import { BaseAdapter } from './models/base_adapter';
import { SaveInstruction } from './models/SaveInstruction';
import { BaseFilters } from './models/base_filters';

@Entity('users')
class User extends BaseModel {
  @Key()
  id!: string;

  name!: string;

  @Ignore()
  transientToken?: string;
}

class InMemoryAdapter extends BaseAdapter {
  private store = new Map<string, any>();

  async save<T extends BaseModel>(instruction: SaveInstruction<T>) {
    const model = instruction.model as unknown as any;
    if (!model.id) model.id = String(Date.now());
    this.store.set(model.id, { ...model });
    return model;
  }

  async find<T extends BaseModel>(_filters?: BaseFilters) {
    return Array.from(this.store.values());
  }
}

// usage
async function runExample() {
  const adapter = new InMemoryAdapter();
  const user = new User();
  user.name = 'Alice';

  await adapter.save({ model: user });
  const all = await adapter.find();
  console.log('stored users', all);
}

runExample().catch(console.error);

Notes

  • Inspect the concrete implementations in src/models and src/decorators for exact method signatures and additional helpers.
  • To build the package from the workspace root (using pnpm):
pnpm --filter core run build

If you'd like, I can also add a small test or example runner file under packages/core/examples/ that demonstrates this code running within the repo.