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

@classytic/directory

v0.2.0

Published

Business directory kernel with claimed-owner editing, listings, locations, taxonomy, and geo discovery.

Readme

@classytic/directory

Source-available business-directory kernel for MongoDB. It models directory sites, businesses, locations, taxonomy, published listings, ownership claims, verified-owner editing, regulated-provider applications, media references, and geographic discovery.

The package is framework-independent: it contains Mongoose models, MongoKit repositories, domain transitions, and Zod schemas. HTTP, authentication, permissions, storage providers, and frontend behavior belong in the consuming host or @spinekit/directory.

Design

  • One directory operator deployment by default; row-level tenancy is opt-in.
  • Business identity is separate from its publication as a directory listing.
  • Businesses may have physical, service-area, or online locations.
  • Listing publication and verification transitions use atomic compare-and-set repository operations.
  • Ownership approval transfers the listing and business to the claimant in one transaction.
  • Rejected claims remain immutable; corrections create a linked resubmission.
  • Provider applications snapshot a versioned verification template, keep evidence separate from public listings, and recheck Media references at final approval.
  • Media is stored as ExternalRef values. This kernel does not select or call a media-storage provider.
  • Geo coordinates use the shared Classytic address/GeoJSON primitives and MongoDB 2dsphere indexes.

Installation

npm install @classytic/directory mongoose @classytic/mongokit \
  @classytic/primitives @classytic/repo-core zod

Node.js 22 or newer is required.

Quick start

import mongoose from 'mongoose';
import { defineDirectory } from '@classytic/directory';

await mongoose.connect(process.env.MONGODB_URI!);

const blueprint = defineDirectory({
  tenant: false,
  autoIndex: process.env.NODE_ENV !== 'production',
});

const directory = blueprint.bind(mongoose.connection);

const site = await directory.repositories.site.create({
  slug: 'dhaka-services',
  name: 'Dhaka Services',
  status: 'active',
  defaultLocale: 'en',
  defaultTimezone: 'Asia/Dhaka',
});

const business = await directory.repositories.business.create({
  name: 'Example Plumbing',
  source: 'operator',
});

await directory.syncIndexes();

The host owns the Mongoose connection. Calling directory.close() therefore does not close the shared connection.

Ownership claims

Claim submission, approval, rejection, and resubmission are exposed through directory.claims. Approval updates the claim, listing verification, listing owner, and business owner transactionally.

MongoDB transactions require a replica set. Development-only standalone MongoDB can be opted into explicitly:

const directory = defineDirectory().bind(mongoose.connection, {
  allowNonTransactional: true,
});

Do not use that fallback when atomic ownership transfer is required.

Tenancy

The default is a single directory deployment:

defineDirectory({ tenant: false });

Reusable hosts that genuinely require field tenancy may pass a standard TenantConfig through tenant. Listed businesses and claimants are content and users; they are not automatically tenants.

Exports

  • @classytic/directory — engine, repositories, document types, shared primitive aliases, and domain services.
  • @classytic/directory/schemas — strict Zod request/value schemas.

For Arc resources, safe public projections, owner routes, and frontend wire contracts, use @spinekit/directory.

License

This package is source-available, not open source. Evaluation and development use are permitted under the included license. Production use requires a commercial license from Classytic LLC. See LICENSE or contact [email protected].