ExisJS

CLI Usage

The ExisJS CLI (exis / exisjs) can be executed in two primary contexts: globally / on-demand via npx, or locally via your project's package.json scripts.

Global vs. Local Execution

When bootstrapping a brand-new project, invoke the initialization tool using npx:

$ npx exisjs init my-api

Once inside an initialized ExisJS project, execution through npm run ensures deterministic behavior pinned to the local exisjs version in node_modules.

Default Package Scripts

Every ExisJS project scaffolded with init includes the standard script targets in package.json:

{  "scripts": {    "dev": "exisjs dev",    "build": "exisjs build",    "start": "exisjs start",    "test": "exisjs test"  }}

Invoke these scripts using your package manager:

$ npm run dev$ npm run build$ npm run start$ npm test

Passing Arguments via Scripts

To pass options through npm run, append a double-dash (--) before the CLI flags:

# Start the dev server on port 5000$ npm run dev -- -p 5000
# Run a specific test file$ npm test -- tests/users.test.ts

Direct commands can also be called via npx exisjs:

# Scaffold a new resource slice$ npx exisjs g resource users
# Print the routing table$ npx exisjs routes
# Inspect available public exports$ npx exisjs exports
  1. Use npx exisjs init <name> to scaffold new applications.
  2. Use npm run dev for local hot-reloading development with automatic port conflict handling.
  3. Use npx exisjs generate <type> <name> to scaffold file conventions (route, service, schema, boundary, resource).
  4. Use npm test to run the integrated test runner.
  5. Use npm run build and npm run start for production deployment.