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

@hideyukimori/nene2-client

v1.0.0

Published

TypeScript client ecosystem for NENE2 JSON APIs (OpenAPI-aligned)

Readme

nene2-js

License: MIT Node TypeScript

TypeScript ecosystem for NENE2: OpenAPI-aligned types, HTTP client helpers, and Problem Details utilities for apps that consume NENE2 JSON APIs.

Documentation: https://hideyukimori.github.io/nene2-js/ (English, 日本語, Français, 中文, Português, Deutsch)

This repository is not a Node.js port of the PHP framework. The PHP runtime stays in NENE2. MCP stdio servers in PHP live in nene-mcp.

What this repo is for

  • Typed fetch wrappers and shared client boundaries derived from NENE2 OpenAPI
  • RFC 9457 Problem Details parsing and validation-error helpers for TypeScript consumers
  • Optional codegen scripts and published npm packages (@hideyukimori/nene2-client, scoped subpackages later)
  • Documentation and tooling that follow the same Issue-driven workflow as NENE2

What this repo is not for

  • Replacing NENE2 PHP HTTP runtime, routing, middleware, or DI
  • Duplicating nene-mcp (stdio MCP server in PHP)
  • React/Vite starter UI (that remains in NENE2 frontend/ unless explicitly extracted later)
  • Direct database access from AI tools or SDK code
  • Application-specific business logic (belongs in consumer projects and NENE2-FT style trials)

See docs/scope.md for the full in-scope / out-of-scope matrix.

Install (npm)

npm install @hideyukimori/[email protected]

Requires Node 22+ (native fetch) or a browser with fetch. TypeScript consumers get .d.ts from the package.

Monorepo / contributors: clone this repo and use npm run check (builds dist/ and runs pack smoke).

Local layout (sibling of NENE2)

../docker/
├── NENE2/          # PHP framework (contract source: docs/openapi/openapi.yaml)
├── nene2-js/       # this repository
├── nene-mcp/       # PHP MCP stdio library (separate concern)
└── NENE2-FT/       # field-trial reference apps

Clone next to your existing NENE2 checkout:

cd /path/to/parent-of-NENE2
git clone [email protected]:hideyukiMORI/nene2-js.git
cd nene2-js
npm install
npm run check

OpenAPI types: npm run codegen (see Phase 3).

Point local development at a running NENE2 API when needed:

cp .env.example .env
# NENE2_JS_API_BASE_URL=http://localhost:8080

Usage (typed client)

import { createNene2Client, Nene2ClientError } from '@hideyukimori/nene2-client';

const client = createNene2Client({
  baseUrl: 'http://localhost:8080',
  // apiKey: process.env.NENE2_MACHINE_API_KEY,
  // bearer: process.env.NENE2_BEARER_TOKEN,
});

const { health, ping } = await client.smoke();
const root = await client.frameworkSmoke();
const notes = await client.listNotes({ limit: 20 });

// Load balancers may return 503 with status "degraded" — opt in:
const degraded = await client.health({ allowDegraded: true });

try {
  await client.getNote(1);
} catch (err) {
  if (err instanceof Nene2ClientError && err.problem) {
    console.error(err.problem.title, err.problem.detail);
  }
}

Works in Node 22+ and browsers that provide fetch.

Verify the API before live smoke

Port 8080 is not always NENE2. Confirm the canonical health shape:

curl -sS http://localhost:8080/health | jq .
# expect: { "status": "ok", "service": "NENE2" }

Or in TypeScript: await client.health({ strictService: true }) rejects wrong service values.

If you see a different JSON wrapper, point NENE2_JS_API_BASE_URL at a running NENE2 PHP instance (sibling ../NENE2).

Multi-backend live smoke (same client, OpenAPI contract — see ADR 0003):

export NENE2_JS_API_BASE_URL=http://localhost:18080     # NENE2 evac (see ft-evac-ports.md)
export NENE2_JS_PYTHON_BASE_URL=http://localhost:18000  # optional: nene2-python
# export NENE2_JS_NODE_BASE_URL=http://localhost:13000  # optional: nene2-node

npm run verify:backends   # curl /health, /examples/ping, /examples/notes
npm test -- tests/client/live-smoke-matrix.test.ts

Unset URLs are skipped; CI runs fixture tests only. Field-trial friction: ADR 0004.

Documentation site (local)

npm install
npm run docs:dev    # http://localhost:5175
npm run docs:build  # static output → .vitepress/dist

Published on push to main via .github/workflows/docs.yml.

Contributing

Work is GitHub Issue driven. Read docs/CONTRIBUTING.md and docs/workflow.md before opening a PR.

AI agents: start at AGENTS.md.

Consumer DX evidence: field trials (FT30–529 marathon; see methodology, friction registry). Local app sandbox: sibling ../nene2-js-FT/. Quick start: howto/consume-client.md.

Release: docs/development/publish.md · Phase history: docs/phase-2.md.

Related projects

| Project | Role | | ----------------------------------------------------------------------- | -------------------------------------------------------- | | NENE2 | PHP API framework, OpenAPI contract, MCP catalog in-repo | | nene2-node | Node.js framework port (@hideyukimori/nene2-framework) | | nene-mcp | Standalone PHP stdio MCP server | | hideyukimori/nene2 | Composer package for PHP consumers |

License

MIT — see LICENSE.