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

@compilacion/ratchet

v0.0.70

Published

Author ratchet designs against a pinned domain-model version and build them into self-contained TypeScript wrappers.

Downloads

1,441

Readme

@compilacion/ratchet

Author ratchet designs against a pinned domain-model version, and build them into self-contained TypeScript.

A ratchet is a thin wrapper around a generated builder (an entity.action event, or a whole eventGroup) where some inputs are pinned: the pinned fields disappear from the wrapper's parameters and are baked into the body. A ratchet only ever tightens — a pinned field can no longer be set downstream; everything left unpinned stays available.

The package bundles the domain model's runtimecontracts and TypeScript base builders, version-pinned to the release it was published from. That makes authoring model-aware and lets the build produce output that compiles on its own.

npm install @compilacion/ratchet
npm install @compilacion/colleciones-clientos   # peer dep (>=2.1.0) used by generated wrappers

30-second example

import { forModel } from '@compilacion/ratchet';

// 1. author (model-aware: the extends target AND the pinned input are validated)
const config = forModel('immoscoop', '0.1.0')
  .ratchet('haalbaarheidsattest', { version: '1.0' })
  .extend('ctaEngage', 'ctaEngageNew', { ctaId: '12' })
  .toJSON();
# 2. build into a self-contained folder of TypeScript
npx ratchet-build designs.json --out ./ratchet

# validate without building — point it at a file OR a whole folder (CI gate)
npx ratchet-build validate ./ratchets

Documentation

API at a glance

| Export | Purpose | | --- | --- | | forModel(name, version?) | Model-bound entry: .ratchet(), .validate(), .build(), .extendsTargets(), .pinnableKeys(), .model (version asserts the bundled contract) | | ratchet(name, opts, { model }) | Single-extend authoring builder (.extend(target, newName, input, enrichments), .toJSON(), .validate()) | | validateConfig(config) | { errors } — full validation that resolves the bundled model itself from meta.domainModel.modelName. Never throws | | validateDesigns(config, model) | { errors } — structural + extends + input + modelVersion (you supply the model) | | buildRatchetPackage(config, { outDir }) | Build a config into a self-contained folder | | availableModels() / loadModel(name) | List / load the bundled contracts | | ratchetDesignsSchema / validateStructure(config) | The JSON schema + a structural validator | | looksLikeRatchet(obj) | Cheap shape check (meta.domainModel + methods) — used by the folder scan |

CLI:

ratchet-build [build] <designs.json | dir> [--out <dir>]   build one ratchet, or every ratchet in a folder
ratchet-build validate <designs.json | dir>                validate only — writes nothing, exits 1 on any error

A directory is scanned recursively; non-ratchet .json (tsconfig, package.json, …) is skipped and reported. A folder build writes each ratchet into <out>/<meta.name>/.