Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

generator-mnm

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-mnm

Create node modules writing ES6 today compiled with Babel, tested with ava and linted with standard on top of npm scripts Create node modules with es6, test with tape on top of npm scripts

  • 0.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Create node modules writing ES6/ES7 today compiled with Babel, tested with ava, bundled with rollup and linted with standard on top of npm scripts

Install

$ npm install -g yo generator-mnm

Usage

Usage:
  yo mnm:app [options] [<name>]

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
  -a,   --all           # Ask all questions                          Default: false
  -y,   --yes           # Skip some questions, like $ npm init -y    Default: false

Arguments:
  name  # module name
  If provided the module will be created inside ./<name>/
  otherwise it will be created in the current directory

  Examples:

     $ yo mnm
     $ yo mnm myAwesomeModule

    Type: String  Required: false

Example

$ yo mnm -y
   create package.json
   create README.md
   create .gitignore
   create src/index.js
   create test/index.js
   create .travis.yml
   create .babelrc
   create rollup.config.js

Features

  • Made out of many other generators, the main generator only creates a package.json file and a minimal .gitignore file
  • Composable, since the logic to create the README, cli and other files is on their own subgenerator
  • Babel transpiles the code/tests
  • standard to lint the code
  • ava for testing
  • yargs to parse cli arguments (optional)
  • rollup to create a common js compatible bundle
  • npm scripts as the build system

Example

Check https://github.com/maurizzzio/generator-mnm-example

List of npm scripts included

Common tasks

taskdescription
npm testava
npm run buildrollup --config
npm run lintstandard
npm run cleanRemoves all the files inside dist/

Watching files

taskdescription
npm run test:watchSame as npm test but with --watch
npm run build:watchSame as npm run build but with --watch

Pre/Post hooks

Taskdescription
npm run prebuildRun before build, npm clean -s && npm lint -s
npm run preversionRun before version, npm run build

Useful npm commands that you should know

  • npm version major|minor|patch bumps the package version
  • npm run lists all available scripts

Why?

This project is heavily inspired by this article by Keith Cirkel where he describes that the existing build system tools attempt to solve the problems that exist among them "covering up the inadequacies of the other tools while also surfacing their own".

James Halliday who is the creator of many awesome packages like browserify and tape also wrote an article where he points out that the command npm run is "perfectly adequate for everything while maintaining a very tiny configuration footprint."

Articles to read:

Inspiration projects

I'd like to thank iamstarkov for his awesome work on generators that are actually composable

Composability

Just plug in any of the subgenerators or the app generator itself on your generator

Generators used in this project

Workflow

# equivalent to npm init -y
yo mnm -y
# see https://www.npmjs.com/package/ghrepo
ghrepo -m "initial commit"
# see https://www.npmjs.com/package/travisjs
travisjs hook # or travis enable with the travis gem

# if a cli is needed
yo mnm:cli

Development

  • npm test
  • npm test:ci run the tests (open ./test/ci/.tmp to see a generated)

License

2015-2016 MIT © Mauricio Poppe

Keywords

FAQs

Package last updated on 26 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc