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

@platoorg/ts-client

v0.5.0

Published

Code generator that turns a plato-manifest.json into a typed, framework-agnostic client

Readme

@platoorg/ts-client

A TypeScript code generator that reads a Plato plato-manifest.json and emits a fully-typed, framework-agnostic TypeScript client.

Install

npm install @platoorg/ts-client

Usage

npx plato-ts [manifest] [output]

| Argument | Default | Description | |------------|-----------------|------------------------------------| | manifest | plato-manifest.json | Path to your Plato manifest file | | output | plato-client.ts | Where to write the generated file |

Examples

# Run from your project root — looks for plato-manifest.json by default
npx plato-ts

# Custom manifest path
npx plato-ts path/to/plato-manifest.json

# Explicit manifest and output
npx plato-ts src/schemas/plato-manifest.json src/lib/plato/client.ts

Schema sync

@platoorg/ts-client also ships plato-sync — a tool to push your plato-manifest.json schema to a live Plato instance (or preview what would change).

# Apply manifest to your Plato instance
plato-sync

# Preview changes without applying
plato-sync --preview

# Export the current remote schema to a local manifest
plato-sync --export > plato-manifest.json

# Target a specific namespace
plato-sync --namespace=my-blog

Environment variables:

| Variable | Description | |-------------------|--------------------------------------------------| | PLATO_URL | Base URL of your Plato instance (required) | | PLATO_NAMESPACE | Namespace slug (or pass --namespace=<ns>) | | PLATO_API_KEY | Full-access API key | | PLATO_SECRET | Shared secret for zero-config bootstrap |


What gets generated

Interfaces

One TypeScript interface per schema, extending a shared PlatoItem base. Fields marked required: true in the manifest are non-optional.

export interface PlatoItem {
  id: string;
  created_at: string;
  updated_at: string;
}

/** singleton */
export interface Homepage extends PlatoItem {
  hero_title: string;        // required
  hero_subtitle?: string;
  hero_image?: string;       // media asset URL
}

/** collection */
export interface Post extends PlatoItem {
  title: string;             // required
  body?: string;
  published_at?: string;     // ISO 8601 date string
  cover?: string;            // media asset URL
  author?: string;           // ID of related item
  tags?: string[];           // IDs of related items
}

Filter param interfaces (collections only)

export interface PostParams {
  title?: string;
  published_at?: string;
  // ... one key per field
}

PlatoClient class

const client = new PlatoClient(
  'http://localhost:6100',  // Plato base URL
  'my-namespace',           // namespace slug
  'your-api-key',           // optional — omit for public namespaces
);

// singletons
const home = await client.getHomepage();
await client.updateHomepage({ hero_title: 'New headline' });

// collections
const posts = await client.listPost({ published: 'true' });
const post  = await client.getPost('1234567890');
const newPost = await client.createPost({ title: 'Hello world', published: false });
await client.updatePost('1234567890', { title: 'Updated' });
await client.deletePost('1234567890');

Field type mapping

| Plato type | TypeScript type | Notes | |-----------------|-----------------|--------------------------| | string | string | | | number | number | | | boolean | boolean | | | date | string | ISO 8601 date string | | media | string | media asset URL | | relation_one | string | ID of related item | | relation_many | string[] | IDs of related items |

Using as a library

import { generateTypeScript } from '@platoorg/ts-client';
import type { Manifest } from '@platoorg/ts-client';

const manifest: Manifest = JSON.parse(fs.readFileSync('plato-manifest.json', 'utf8'));
const code = generateTypeScript(manifest);
fs.writeFileSync('plato-client.ts', code);