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

@ossy/platform

v1.39.2

Published

Ossy application server runtime

Downloads

13,505

Readme

@ossy/platform

Express-based application server runtime for the Ossy platform. It reads the build manifest produced by @ossy/app build and wires up pages, API routes, tasks, actions, integrations, aggregates, and startup hooks — all without any server-side configuration.

What it does

At startup @ossy/platform:

  1. Loads build/manifest.json produced by @ossy/app build.
  2. Registers and runs all startup hooks (*.startup.js) in order.
  3. Connects all integrations (*.integration.js) by calling connect({ env }).
  4. Registers all tasks (*.task.js) with TaskService and starts the cron scheduler.
  5. Registers all resource templates (*.resource.js) with registerResourceTemplate.
  6. Rebuilds all aggregates (*.aggregate.js) from the event store.
  7. Registers all actions (*.action.js) with ActionService.
  8. Starts an Express server that routes requests to pages (*.page.jsx) and API handlers (*.api.js).
  9. Auto-mounts every action at POST /actions ({ action, payload }).

Quick start

# In your app directory
npm install @ossy/app @ossy/platform

# Build the app
npx app build

# Start the server
npx platform start

Or programmatically:

import { startServer } from '@ossy/platform'

const { port, close } = await startServer({
  cwd: process.cwd(),   // defaults to process.cwd()
  buildDir: 'build',    // defaults to 'build'
  port: 3000,           // also reads --port / PORT env var
})

Server configuration

The server reads configuration from:

  • --port / -p CLI flag, or the PORT environment variable (default 3000).
  • build/manifest.json — produced by @ossy/app build.
  • process.env — used by integrations for their credentials and by startup hooks.

Optional environment variables used by the platform itself:

| Variable | Description | |---|---| | DB_URL | MongoDB connection string. Required for tasks and aggregates. | | API_URL + OSSY_API_KEY | SDK configuration. When set, tasks receive a pre-configured SDK instance. | | PORT | HTTP port. |

Exported API

import {
  startServer,
  loadManifest,
  resolveEntryUrl,
  ConfigService,
  ActionService,
  StorageClient,
  S3Client,
  LocalStorageClient,
  getSystemResourceTemplates,
  normalizeAndValidateDocumentContent,
  validateResourceTemplatesForImport,
} from '@ossy/platform'

ActionService

Registry for *.action.js command handlers.

import { ActionService } from '@ossy/platform'

// Invoke an action from server-side code (bypasses HTTP)
const result = await ActionService.invoke('orders/create', {
  payload: { ... },
  req: { userId: 'user-123', workspaceId: 'ws-456' },
})

// Look up a registered action
const action = ActionService.get('orders/create')  // { id, access, run } | null

// List all registered actions
const all = ActionService.all()

getSystemResourceTemplates

Returns all resource templates registered from *.resource.js files.

import { getSystemResourceTemplates } from '@ossy/platform'

const templates = getSystemResourceTemplates()
// [{ id: '@ossy/tool/doc', name: 'Tool Doc', fields: [...] }, ...]

Primitives

The platform is built around file conventions called primitives. Each primitive is a file with a specific naming pattern that the build pipeline auto-discovers.

→ See PRIMITIVES.md for the complete reference.

| Primitive | Pattern | Purpose | |---|---|---| | Page | *.page.jsx | Routable UI (SSR + hydration) | | API | *.api.js | HTTP endpoint (any method) | | Task | *.task.js | Event-driven or scheduled async work | | Action | *.action.js | Named intent, auto-exposed at POST /actions | | Integration | *.integration.js | Third-party client connected at startup | | Email | *.email.jsx | Transactional React email template | | Component | *.component.jsx | Injectable UI fragment | | Resource | *.resource.js | Custom document-type schema | | Aggregate | *.aggregate.js | Event-sourced domain object | | Startup | *.startup.js | One-time boot hook |

Request lifecycle

Incoming request
  │
  ├─ POST /actions  ──► ActionService.invoke() ──► TaskService.invoke() ──► task.run({ payload, sdk, log, integrations, req })
  │
  ├─ Match API route    ──► api.handle(req, res)
  │
  └─ Match page route   ──► page.render(props) ──► HTML response

Requests that do not match an API route or page route receive 404 Not Found.

Related packages

| Package | Purpose | |---|---| | @ossy/app | Build pipeline — discovers primitives, bundles them, writes manifest.json | | @ossy/event-store | Event sourcing primitives (Aggregate, EventStore) | | @ossy/email | Email renderer and email.integration.js | | @ossy/observability | Structured logger and metrics | | @ossy/router | URL matching used by the platform server |