ezy

0.0.16 • Public • Published

ezy

Common dev tasks as a module.

Ezy is a swappable* starting place for Javascript projects providing a framework-like CLI for vanilla JS. Start writing Javascript now and worry about configuration later. Get the benefits of Rollup, Browserify, Babel/ES2015, ESLint, Tape & NYC/Istanbul while barely lifting a finger for configuration.

Swappable means ezy won't pollute your package.json file with config details. The idea is to start with ezy and add in your config details when you need them.

Note: This project will be unstable until v1.0.0.

Install

$ npm install ezy -g

Note: at the moment ezy only works in global mode.

Usage:

If you're starting from scratch, the first thing to do is to create your project directory, where <project> is your project's name.

ezy new <project>

cd into your new project and run npm init.

Run ezy as a global command:

$ ezy

Running ezy in your new project dir will ask you to create an ezy.config.json file and an entry js file.

This creates a simple dir structure:

/project-name
  / src
    - index.js
  - ezy.config.json
  - package.json

and ezy.config.json:

{
  "entryDir": "src",
  "entry": "index.js",
  "outputDir": "dist",
  "output": "bundle.js",
  "outputBrowserSuffix": "browser",
  "testDir": "test"
}

Once this file has been generated, ezy will run again and you'll be presented with a number of tasks.

Tasks

  1. Run Project - With Node, ES6 or the browser.
  2. Test Project - With Tape. Ezy will ask to install Tape if you don't have it.
  3. View Coverage - View coverage reports in the browser.
  4. Bundle Project - Uses rollup to create a final bundle of your project, located at your preset outputDir.
  5. Browserify Project - Similar to 'BundleProject' except it also browserifies the output file.
  6. Check Updates - Check for dependency updates.
  7. Run Updates - Run dependency updates.
  8. Add Babel Preset - Adds babel presets for testing and running ES6.
  9. Add Wallaby Config - Adds config for wallaby.js.
  10. Add ESLint - Adds Airbnb eslint modules and .eslintrc file.
  11. Add ezy Config - Adds the basic ezy config.

Usage Extras:

ES6

If you plan on using ES6, it's best to run the babel preset generator before running tests or bundling.

Run Modes

Node - Running a project in node mode is the same as running node dist/bundle.js.

ES6 - Running a project in ES6 mode will rollup src/index.js with ES6 and pipe it to node.

Browser - Running a project in browser mode will first check to see if there is an index.html file in your outputDir, if not, ezy will ask you to generate it and finally use browser-sync to run all files in the outputDir.

In browser mode, you may still need to use "browserify" or equivalent on your output bundle and adjust your index.html file.

"scripts": {
  "browserify": "browserify dist/bundle.js -o bundle-browser.js",
  "bundle": "ezy bundle; npm run browserify",
  "browser": "npm run bundle; ezy run browser"
}

CLI Usage

$ ezy bundle - Bundles up your project like normal.

$ ezy test - Tests your project with tape. With or without ES6.

$ ezy run <es6/node/browser> - Runs your project with node or the browser.

$ ezy new <name> - Simply creates a dir with the specified name and generates a command for npm init.

Dependents (0)

Package Sidebar

Install

npm i ezy

Weekly Downloads

4

Version

0.0.16

License

ISC

Last publish

Collaborators

  • louisr