generator-hapi-composer

0.1.8 • Public • Published

Hapi.js composer generator

NPM version Build Status Dependency Status Coverage Status

This generator creates a new hapi project with all the boilerplate you need to get started. The hapi-plugins selection in the prompt will be automatically added to the composer manifest.

Installation

Install the generator by running: npm install -g generator-hapi-composer

Usage

Make a new directory, and cd into it. Run the following command and follow the prompts.

yo hapi-composer

Note that this template will generate files in the current directory, so be sure to first change to a new directory if you don't want to overwrite existing files.

Hapi plugins

The generator provides the following optional selection of hapi-plugins by default:

You can customize the hapi-plugins prompt by editing the .yo-rc-global.json file which is located in your home directory. The file will be generated after the first run if it doesn't already exist. The default hapi-plugin configuration in .yo-rc-global.json looks like this:

{
  "generator-hapi-composer": {
  "hapiPlugins": [
        {
          "name": "lout",
          "description": "API documentation generator"
        },
        {
          "name": "hapi-auth-cookie",
          "description": "Cookie authentication plugin"
        },
        {
          "name": "bell",
          "description": "Third-party login plugin"
        },
        {
          "name": "hapi-auth-basic",
          "description": "Basic authentication plugin"
        },
        {
          "name": "tv",
          "description": "Interactive debug console"
        },
        {
          "name": "scooter",
          "description": "User-agent information plugin"
        },
        {
          "name": "poop",
          "description": "Plugin for handling uncaught exceptions"
        },
        {
          "name": "good",
          "description": "Server and process monitoring plugin"
        },
        {
          "name": "reptile",
          "description": "Plugin for creating a REPL"
        },
        {
          "name": "yar",
          "description": "Session plugin and cookie jar"
        },
        {
          "name": "crumb",
          "description": "CSRF crumb generation and validation"
        }
      ]
  }
}

npm modules

The generator provides the following optional selection of npm modules by default:

You can customize the npm-modules prompt by editing the .yo-rc-global.json file which is located in your home directory. The file will be generated after the first run if it doesn't already exist. The default npm-modules configuration in .yo-rc-global.json looks like this:

{
  "generator-hapi-composer": {
    "npmModules": [
      {
        "name": "joi",
        "description": "Object schema validation"
      },
      {
        "name": "boom",
        "description": "HTTP-friendly error objects"
      },
      {
        "name": "catbox",
        "description": "Multi-strategy object caching service"
      }
    ]
  }
}

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.

Support

Should you have any problems or wishes for improvements, feel free to open up an issue.

Credits

This generator is based on the generator-node-gulp.

Contributors

License

Copyright (c) 2014 Kentaro Wakayama. Licensed under the MIT License.

Package Sidebar

Install

npm i generator-hapi-composer

Weekly Downloads

2

Version

0.1.8

License

MIT

Last publish

Collaborators

  • kojiwakayama
  • kwakayama