Skip to content

Installation

Requirements

  • Node.js 18 or later
  • npm, pnpm, bun, or yarn

Install Globally

bash
npm install -g fexapi
bash
pnpm add -g fexapi
bash
bun add --global fexapi
bash
yarn global add fexapi

After installing, verify it works:

bash
fexapi --help

Use Without Installing

You can run FexAPI directly with your package manager:

Legend: npx = npm, pnpm dlx = pnpm, bunx = bun, yarn dlx = yarn.

bash
npx fexapi@latest init
bash
pnpm dlx fexapi@latest init
bash
bunx fexapi@latest init
bash
yarn dlx fexapi@latest init

Add to a Project

Install as a dev dependency in an existing project:

bash
npm install -D fexapi
bash
pnpm add -D fexapi
bash
bun add -d fexapi
bash
yarn add -D fexapi

Then add scripts to your package.json:

json
{
  "scripts": {
    "mock:init": "fexapi init",
    "mock:generate": "fexapi generate",
    "mock:dev": "fexapi dev --watch",
    "mock:serve": "fexapi serve"
  }
}

Next Steps

Once installed, head to the Quick Start guide.

Released under the MIT License.