hapi pal CLI
raw JSON →hpal is the command-line interface (CLI) for the hapi pal ecosystem, designed to streamline the development of Hapi.js applications. Currently at version 2.6.0, hpal offers tools for rapidly scaffolding new Hapi projects based on the official pal boilerplate, generating common application components like routes, models (using schwifty), and services (using schmervice) through haute-couture conventions, and providing a command-line interface to search Hapi and related package documentation (e.g., Joi, Toys). It also enables the execution of custom commands defined by Hapi server plugins. The tool is maintained as part of the hapipal initiative, focusing on convention over configuration for Hapi development, and is primarily intended for use via npx as a development dependency.
Common errors
error hpal: command not found ↓
npm install --save-dev hpal) and then run commands using npx hpal <command>. error Error: hpal make expects a .hc.js file in the project root or specified plugin directory. ↓
.hc.js file in your project's root, even if empty, or scaffold your project using npx hpal new which includes this configuration. error Error: Plugin 'my-plugin' requires hapi version '20.x.x' but found '17.x.x'. ↓
Warnings
gotcha hpal is designed for use with Hapi.js v17+ and Node.js v8+ environments. Using it with older versions of Hapi or Node.js may lead to unexpected behavior or errors. ↓
gotcha The recommended installation method for hpal is as a development dependency, invoked via `npx`. Avoid global installation (`npm install -g hpal`) to prevent version conflicts and ensure projects use their specified hpal version. ↓
gotcha The `hpal make` command requires a `.hc.js` file to be present in your project's root or the specified plugin directory. This file dictates the haute-couture conventions for file generation. ↓
Install
npm install hpal yarn add hpal pnpm add hpal Imports
- hpal wrong
hpal <command> <options>correctnpx hpal <command> <options> - hpal new
npx hpal new <project-directory> - hpal make
npx hpal make <item-type> <item-name>
Quickstart
npm install --save-dev hpal
npx hpal docs --ver 18.1.0 h.response