Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ygor

shannonmoeller77MIT6.0.2

For when 'npm run' isn't enough and everything else is too much.

broccoli, cake, grunt, gulp, jake, make, nake, npm, rake, run, runner, scripts, shell, start, task

readme

ygor

For when npm run isn't enough and everything else is too much.

version downloads build status coverage status


Ygor is a no-frills toolkit consisting of a task runner and a file transformer. Enjoy as a whole or a la carte. Built on promises to work wonderfully with async and await in Node.js 8 and above.

Node is the CLI, npm is the plugin system. Go nuts.

Install

$ npm install --save-dev ygor

Usage

Create a JavaScript file, write some functions, tell Ygor.

// make.js

const { tasks, shell, find, read, write } = require('ygor');
const { transform } = require('babel-core');

function buildCss() {
  return shell`postcss --use autoprefixer --dir dest src/**/*.css`;
}

function buildJs(cli) {
  return find('src/**/*.js')
    .map(read())
    .map(async (file) => {
      const { code } = await transform(file.contents, cli);

      file.contents = code;

      return file;
    })
    .map(write('dest'));
}

async function build(cli) {
  await buildCss(cli);
  await buildJs(cli);
}

tasks
  .add('css', buildCss);
  .add('js', buildJs)
  .add('default', build);

To run a task, execute the file with Node.js and indicate which task to perform.

$ node make js --minified

API

See the individual packages for complete documentation:


MIT © Shannon Moeller