generator-es-module

Scaffold out an ECMAScript module.

Usage no npm install needed!

<script type="module">
  import generatorEsModule from 'https://cdn.skypack.dev/generator-es-module';
</script>

README

generator-es-module

code style: prettier Dependency Status DevDependency Status Travis Build Status NPM Downloads

Scaffold out an ECMAScript module.

Features:

  • Prettier code formatter
  • Git pre commit hook
  • Optional Web browser support (AKA Babel support)
  • Optional CLI
  • Optional test coverage

Install

$ npm install -g yo generator-es-module

Usage

With yo:

$ yo es-module

There are multiple command-line options available:

$ yo es-module --help

Usage:
  yo es-module [options]

Options:
  -h,   --help          # Print the generator's options and usage
        --skip-cache    # Do not remember prompt answers                      Default: false
        --skip-install  # Do not automatically install dependencies           Default: false
        --web-browser   # Add support for web browser
        --org           # Publish to a GitHub organization account
        --cli           # Add a CLI
        --coverage      # Add code coverage with nyc
        --codecov       # Upload coverage to codecov.io (implies coverage)
  • The --web-browser option add babel related packages in order to support Web browser environments.
  • The --org option takes a string value (i.e. --org=2players). All others are boolean flags and can be negated with the no prefix (i.e. --no-codecov). You will be prompted for any options not passed on the command-line.

Tip

Use chalk if you want colors in your CLI.

License

MIT © m31271n