@hurl/cli

1.0.5 • Public • Published

Hurl: Template File Generator

Table of Contents

Installation

Using npm:

npm install -g @hurl/cli

NPM Installation GIF

Using yarn:

yarn global add @hurl/cli

Yarn Installation GIF

Commands

init

Initialize Hurl

Options

  • --skip: Skip prompts and create default config
    • Type: boolean
    • Default: false
    • Alias: -s
  • --examples: Include example templates when creating config
    • Type: boolean
    • Default: true
    • Alias: -e

Examples

  • Basic (with prompts & examples)

    $ hurl init

    Resulting folder structure:

    project
    │
    └───.hurl
    │   │   .hurl.<js|json|yml|ts>
    │   │
    │   └───templates
    │       │   <language>-example.<js|ts>
    │       │   <language>-example.<js|ts>
    │       │   ...
    
  • Skip prompts

    $ hurl init -s
    $ hurl init --skip
    $ hurl init --skip=true

    Resulting folder structure:

    project
    │
    └───.hurl
    │   │   .hurl.json
    │   │
    │   └───templates
    │       │   <empty>
    
  • Don't create example templates

    $ hurl init -e=false
    $ hurl init --examples=false
    $ hurl init --no-examples

    Resulting folder structure:

    project
    │
    └───.hurl
    │   │   .hurl.<js|json|yml|ts>
    │   │
    │   └───templates
    │       │   <empty>
    

generate

Generate files from a template

Options

  • --paths: The paths to the new files
    • Type: string[]
    • Alias: -p
    • Required
  • --template: The name of the template file/folder
    • Type: string
    • Alias: -t
    • Required
  • --confirm: Should confirm when overriding an existing file
    • Type: boolean
    • Default: true
  • --<some-variable-name>: Value for some template variable
    • Type: string

Examples

  • Create single file with no variables

    $ hurl generate -p example.js -t template.js
  • Create multiple files with no variables

    $ hurl generate -p example.js example2.js -t template.js
  • Create files with variables

    $ hurl generate -p example.js -t example.js --var=value

Package Sidebar

Install

npm i @hurl/cli

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

590 kB

Total Files

5

Last publish

Collaborators

  • yasht