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

@biorate/symbolic

v3.1.1

Published

Symbols factory

Readme

@biorate/symbolic

Symbols factory — isolated and global Symbol registries with lazy creation via Proxy.

Features

  • create(label) — creates an isolated namespace with lazy Symbol creation and caching.
  • Global — global singleton registry backed by Symbol.for() with sub-namespace support.
  • Zero dependencies — pure JS, no runtime libraries.
  • Type-safe — full TypeScript declarations.

Installation

pnpm add @biorate/symbolic

No runtime dependencies.

Module reference

create(label) — Isolated namespace factory

import { create } from '@biorate/symbolic';

const Namespace1 = create('Namespace1');
const Namespace2 = create('Namespace2');

Returns a Proxy object where every property access lazily creates and caches a unique Symbol.

| Export | Signature | Description | |---------|----------------------------------------|---------------------------------------------------| | create| (label: string) => Record<string, symbol> | Creates a new isolated symbol namespace. |

Behaviour:

const A = create('A');
const B = create('B');

A.foo === A.foo;   // true  — cached within the same namespace
A.foo === B.foo;   // false — different namespaces are isolated

Internally uses ES2020 private class fields (#map) and Proxy.get / Proxy.has traps.

Global — Global singleton registry

import { Global } from '@biorate/symbolic';

A singleton Proxy-backed object that delegates to Symbol.for() for global symbol registration.

| Export | Signature | Description | |----------|------------------------------------------------|-----------------------------------------------| | Global | const Global: Proxify & { [key: string]: symbol } | Global symbol registry via Symbol.for(). |

Direct access:

Global.Foo === Global.Foo;   // true — Symbol.for('Global.Foo')
Global.Foo === Global.Bar;   // false

Namespaced access (callable):

const MyNs = Global('MyNs');
MyNs.Test === MyNs.Test;     // true — Symbol.for('MyNs.Test')

The returned value is itself callable, allowing nested namespaces.

Key differences

| Aspect | create(label) | Global | |---------------------|-------------------------|-----------------------------| | Backend | Symbol() (local) | Symbol.for() (global) | | Isolation | Full — separate Map | Global — shared across modules | | Collision risk | None between creates | Possible if same key in different modules | | Callable | No | Yes — Global('ns').Key |

Usage patterns

DI token isolation

import { create } from '@biorate/symbolic';

const Tokens = create('MyApp');
// Tokens.Logger, Tokens.Config, Tokens.Database — all unique Symbols

Framework-level constants with Global

import { Global } from '@biorate/symbolic';

// In package A:
const Metadata = Global('Metadata');
export const Keys = Metadata;

// In package B:
import { Global } from '@biorate/symbolic';
Global('Metadata').Route === Global('Metadata').Route; // true

Architecture

create(label)
│
└── new Proxy(target, handler)
    ├── Proxy.get(target, key)
    │   └── #map.has(key) ? #map.get(key) : (#map.set(key, Symbol(`${label}.${key}`)), #map.get(key))
    └── Proxy.has(target, key)
        └── #map.has(key)
Global
│
└── new Proxy(function(){}, Proxify)
    ├── Proxy.get(target, key)
    │   └── Symbol.for(`Global.${key}`)
    └── Proxy.apply(target, thisArg, [namespace])
        └── new Proxy({}, Proxify)  // with prefix = namespace
            └── get → Symbol.for(`${namespace}.${key}`)

Learn

  • Documentation can be found here - docs.

Release History

See the CHANGELOG

License

MIT

Copyright (c) 2021-present Leonid Levkin (llevkin)