Skip to content

Quick start

Turn an installed npm package’s TypeScript declarations into F# bindings for your Fable app.

1. Install the tool

You need the .NET 10 SDK, Node.js, and npm. See Installation for setup and updates.

Terminal
dotnet tool install --global xantham
xantham tsc init

2. Install a package

Start with a small package that includes its own declarations:

Terminal
mkdir my-bindings
cd my-bindings
npm init -y
npm install --save-exact ansi-regex@6.3.0

Keep the npm version pinned so later runs use the same declarations.

3. Generate the binding

Terminal
xantham generate ./node_modules/ansi-regex -o ./out
  • out
    • AnsiRegex.fs
    • manifest.json
    • symbols.jsonl
Your binding

AnsiRegex.fs

The F# types and imports to add to your Fable project.

Your report

manifest.json + symbols.jsonl

A summary of the mapping quality, plus findings for individual symbols.

4. Use it in Fable

Add the support packages and include the generated file before code that uses it. Continue with Using bindings for the project setup.

Edit this page