napejs.org valid
@newkrok/nape-js
Modern TypeScript 2D physics engine for the web. Fully typed, with object pooling and dual ESM/CJS exports (~175 KB gzip bundled). Originally ported from the Haxe Nape engine by Luca Deltodesco.
Their llms.txt
The beginning of the file, from our validated copy saved 2026-10-23T05:47:12.620Z. Cached copy · Source on napejs.org
# @newkrok/nape-js
> Modern TypeScript 2D physics engine for the web. Fully typed, with object pooling and dual ESM/CJS exports (~175 KB gzip bundled). Originally ported from the Haxe Nape engine by Luca Deltodesco.
Install: `npm install @newkrok/nape-js`
- [GitHub Repository](https://github.com/NewKrok/nape-js): Source code, issues, contributing guide
- [npm Package](https://www.npmjs.com/package/@newkrok/nape-js): Published package with TypeScript declarations
- [API Reference](https://napejs.org/api/index.html): Full TypeDoc-generated API docs
- [Interactive Demos](https://napejs.org/examples): Live physics demos with source code — every demo also has its own page at https://napejs.org/examples/<id>/
- [Games built on nape-js](https://napejs.org/games/): Complete playable game demos (AI, waves, cameras, 3D rigs) and shipped titles — the reference for "how do I build X" questions
- [Full LLM Documentation](https://raw.githubusercontent.com/NewKrok/nape-js/master/packages/nape-js/llms-full.txt): Complete API reference in a single file
- [Prompt Collection](https://napejs.org/ai.html): Copy-paste prompts for building a game with an LLM, plus the API mistakes models reliably make
- [Cookbook](https://napejs.org/guides/cookbook/): Task-oriented recipes (platformer, ragdoll, fluid, serialization, replay, etc.)
- [Replay Guide](https://napejs.org/guides/replay-guide/): Recorder + Player + binary encode/decode + determinism contract
- [Troubleshooting](https://napejs.org/guides/troubleshooting/): Common problems and solutions
- [Anti-Patterns](https://napejs.org/guides/anti-patterns/): Common mistakes to avoid
- [PixiJS Integration](https://www.npmjs.com/package/@newkrok/nape-pixi) (`@newkrok/nape-pixi`): Sibling package — body/sprite sync, fixed-step render interpolation, debug draw, and off-thread physics bridge. PIXI v8.
## Quick Start
```typescript
import { Space, Body, BodyType, Vec2, Circle, Polygon } from "@newkrok/nape-js";
const space = new Space(new Vec2(0, 600));
const floor = new Body(BodyType.STATIC, new Vec2(400, 550));
floor.shapes.add(new Polygon(Polygon.box(800, 20)));
floor.space = space;
const ball = new Body(BodyType.DYNAMIC, new Vec2(400, 100));
ball.shapes.add(new Circle(20));
ball.space = space;
function update() {
space.step(1 / 60);
}
```
Version check: `import { VERSION } from "@newkrok/nape-js"` — or, after any import, read the `__NAPE_JS__` global in the console (three.js-style).
## Common Mistakes (read before generating code)
These are the places nape-js differs from Box2D/Matter.js, where models most often generate broken code.
- **No `space.add()`** — a body joins the world by assignment: `body.space = space`. Shapes attach with `body.shapes.add(shape)`.
- **No `body.applyForce()`** — assign `body.force = new Vec2(x, y)`. The value **persists across `space.step()`**, so clear it each frame unless you want accumulation. `body.applyImpulse(vec)` is a real method and is usually the right one.
- **Fast bodies
…
Machine-readable: GET /v1/resolve?q=napejs.org · GET /v1/domain/napejs.org · this page as Accept: application/json or text/markdown · MCP lookup_domain
Automatically discovered from public files. Inclusion does not imply endorsement or publisher participation.
Own or manage this website?
If you own or manage napejs.org, you can update its listing and review file health, discovery activity and score history.
Manage this listing — optional
What verification unlocks
See how your site is discovered—and control what agents see.
- Control what agents see
Edit your listing description, tags, public contact details and additional llms.txt paths. Publish your terms for automated access, attribution and pricing.
- Make your profile eligible for search
A valid, listed, unblocked, verified profile can appear in our publisher sitemap and become eligible for search-engine visibility. Search engines decide what to index and rank.
- Appear in our llms-full.txt
Eligible verified publishers are listed by name, with their file links and summaries, in the service overview agents can read.
Free. No account registration, backlink or payment required. Public discovery remains available without verification.
Let your coding agent verify it
If your coding agent is authorized to manage this website, paste these instructions into it.
Claim my listing on Agent Web Map for napejs.org:
1. POST https://agentwebmap.com/v1/sites/napejs.org/claims and keep claim_id and claim_secret private.
2. Publish the proof: add the line "AgentWebMap ownership: <token>" (token from step 1) to https://napejs.org/llms.txt, or use the DNS, meta-tag or well-known method the response describes.
3. POST https://agentwebmap.com/v1/sites/napejs.org/verify with {"claim_id": "...", "claim_secret": "..."}.
4. Save the api_key from the answer; it manages the listing (PATCH https://agentwebmap.com/v1/sites/napejs.org).
MCP equivalent: tools begin_ownership_claim, then verify_domain, at https://agentwebmap.com/mcp. Docs: https://agentwebmap.com/docs#verifyCorrections or removal requests: contact the directory.