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

@lorion-org/surface-activation

v1.0.0-beta.8

Published

Framework-free surface-activation convention: which module and export provides a capability's surface, and the import specifier to reach it.

Readme

@lorion-org/surface-activation

Framework-free surface activation: given a capability that lives as an on-disk package, decide which module and exported symbol provides a named "surface" (for example web or server), and build the import specifier to reach it — by file-layout convention, with no surface config in the descriptor.

It is pure: no filesystem access, no framework, no runtime. The same seam is shared by build-time hosts (which code-generate static imports) and runtime hosts (which dynamically import()), so the addressing rule lives in exactly one place instead of being reinvented per host.

Concepts

  • SurfaceConvention — how a host detects a surface (marker), names its export (exportName(id)), and where it is exported from (exportSubpath).
  • conventionActivation(surfaces) — builds an ActivationResolver from per-surface conventions.
  • fileSurfaceConvention(options) — a ready-made SurfaceConvention for the common file-layout case: the surface exists when one of files is present, and its export is camelCase(id) + exportSuffix. It bakes the marker and naming so a host stops repeating them per surface; existence is injected (exists) so this package stays I/O-free.
  • capabilitySpecifier(packageName, exportSubpath) — the one rule for a capability's import specifier (@acme/shops + ./web@acme/shops/web).
  • resolveSurfaceModules(active, surface, activation) — for each active capability that provides the surface, the specifier and export name to import.

Usage

import { existsSync } from 'node:fs';
import { join } from 'node:path';
import {
  conventionActivation,
  fileSurfaceConvention,
  resolveSurfaceModules,
} from '@lorion-org/surface-activation';

const activation = conventionActivation({
  web: fileSurfaceConvention({
    files: ['src/web.ts'], // surface present when any listed file exists
    exportSuffix: 'WebPlugin', // exportName = camelCase(id) + suffix
    exportSubpath: './web',
    exists: existsSync, // injected — the package itself touches no filesystem
    join, // optional; defaults to a POSIX join
  }),
});

// `active` is any list of { id, directory, packageName } items.
const modules = resolveSurfaceModules(active, 'web', activation);
// -> [{ capability, specifier: '@acme/shops/web', exportName: 'shopsWebPlugin' }, ...]

The convention is the only surface-specific part: swap exportSuffix/exportSubpath (and files) for a server surface, an api surface, or any other. The raw SurfaceConvention object stays available for cases the preset does not cover.

A build-time host emits a static import per entry; a runtime host feeds each specifier to a dynamic import(). Both use the identical list.

Consumers in this repo

  • @lorion-org/capability-composition — feeds the specifiers to its runtime composeCapabilities loop, and re-exports the convention builders (conventionActivation, fileSurfaceConvention) and their types for callers of that loop. The build-time addressing tools (resolveSurfaceModules, capabilitySpecifier) are imported from this package directly.
  • @lorion-org/react — uses capabilitySpecifier when code-generating static capability imports at build time.