Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Promptfoo Promptfoo Package Manifest

From Leeroopedia
Knowledge Sources
Domains Build_System, Configuration
Last Updated 2026-02-14 07:45 GMT

Overview

Root npm package manifest that defines the promptfoo package metadata, build scripts, dependencies, entry points, and workspace configuration.

Description

The Package_Manifest (package.json) is the root npm configuration for the promptfoo package. It defines the package as an ESM module (type: module), specifies dual entry points (ESM index.js and CJS index.cjs), configures binary commands (promptfoo and pf), lists 100+ dependencies, defines 30+ npm scripts for building, testing, linting, and development, and sets up workspaces for src/app (web UI) and site (docs). The engines field constrains Node.js to ^20.20.0 || >=22.22.0.

Usage

This file is consumed by npm/pnpm/yarn for dependency installation, script execution, and package publishing.

Code Reference

Source Location

Signature

{
  "name": "promptfoo",
  "version": "0.120.24",
  "type": "module",
  "main": "./dist/src/index.js",
  "bin": {
    "promptfoo": "dist/src/entrypoint.js",
    "pf": "dist/src/entrypoint.js"
  },
  "engines": { "node": "^20.20.0 || >=22.22.0" }
}

Import

# Install the package
npm install promptfoo

# Or use via npx
npx promptfoo@latest eval

I/O Contract

Inputs

Name Type Required Description
(none) Configuration read by npm/node package manager

Outputs

Name Type Description
package config JSON Package metadata, scripts, and dependency graph

Usage Examples

# Core commands defined in package.json scripts
npm run build         # Build TypeScript + web UI
npm test              # Run all Vitest tests
npm run dev           # Start development server + web UI
npm run lint          # Run Biome linter
npm run local -- eval # Test with local build

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment