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

@procedures/predicates

v0.68.10

Published

The functions of @mark1russell7/predicates as procedures, made from its types: robust orientation, in-circle and segment tests as typed calls, MCP tools and CLI commands.

Readme

@procedures/predicates

npm

The functions of @mark1russell7/predicates as procedures: robust geometric predicates: the orientation of three points, the in-circle test and the classification of two segments. The sign is exact, also where the floating-point determinant rounds to the wrong sign. Each procedure is a typed call, an MCP tool and a CLI command.

No procedure is written by hand. The generator of @procedures/compiler reads the types of the library and writes src/manifest.ts. Thus a procedure cannot drift from its function.

Install

pnpm add @procedures/predicates @procedures/client

A host registers the procedures with createRegistry(predicatesModule), or with import "@procedures/predicates/register" for the global registry. The package root and ./module register nothing.

Procedures

The package has 13 procedures in the namespace predicates, one for each function of the library with JSON inputs and a JSON output. Each procedure has no effects: it reads nothing and writes nothing.

  • The input is an object with one property for each parameter of the function, by its name.
  • The JSON Schemas of the input and the output come from the types. A named type has one definition in $defs.
  • Each coordinate is one number property, for example ax and ay for the point a.
  • The procedures orient2dSign and incircleSign give -1, 0 or 1. The procedures orient2d and incircle also give the stage of the filter that decided the sign.

predicatesManifest gives the names, the schemas and the effects of each procedure.

Example

import { createRegistry, invokePath, outputValue } from "@procedures/client";
import { predicatesModule } from "@procedures/predicates";

const registry = createRegistry(predicatesModule);
const output = await invokePath(["predicates", "orient2dSign"], { ax: 0, ay: 0, bx: 10, by: 10, cx: 3, cy: 6 }, { registry });
const value = await outputValue(output);

The functions with no procedure

Each function of the library has a procedure.

Update the manifest

After an update of @mark1russell7/predicates, start this command from the root of the repository:

node scripts/wraps.ts generate --package predicates

The command writes src/manifest.ts. It also raises the ratchet of the library in wraps.coverage.json. CI starts node scripts/wraps.ts check. The check fails when the manifest is not current, or when the share of the functions with a procedure falls.

The release train starts the root script release-train:update after it updates a general package. When the check fails, the script starts node scripts/wraps.ts generate for all wraps.

The gate of a pure wrap

The wrap is pure: its wrap.json has "pure": true. So node scripts/wraps.ts check also examines these conditions:

  • Each procedure has no effects.
  • The field client.browser lists ., ./module and ./register.
  • A program of wraps.programs.json uses a procedure of the wrap.

The programs of wraps.programs.json, at the root of the repository, use the procedures of the pure wraps, also across libraries. The check starts each program two times. The two results must be equal, and equal to the recorded result.

License

MIT