ygor

6.0.2 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
6.0.24latest
5.0.0-50beta

Version History

VersionDownloads (Last 7 Days)Published
6.0.24
6.0.10
6.0.00
5.4.00
5.3.00
5.2.30
5.2.20
5.2.10
5.2.00
5.1.60
5.1.50
5.1.40
5.1.30
5.1.20
5.1.10
5.1.00
5.0.00
5.0.0-90
5.0.0-80
5.0.0-70
5.0.0-60
5.0.0-50
5.0.0-40
5.0.0-30
5.0.0-20
4.0.40
4.0.30
4.0.20
4.0.10
4.0.00
3.0.10
3.0.00
2.2.41
2.2.30
2.2.20
2.2.10
2.2.00
2.1.00
2.0.00
1.7.00
1.6.00
1.5.40
1.5.30
1.5.20
1.5.10
1.5.00
1.4.10
1.4.00
1.3.20
1.3.10
1.3.00
1.2.20
1.2.10
1.2.01
1.1.00
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i ygor

Weekly Downloads

6

Version

6.0.2

License

MIT

Unpacked Size

5.02 kB

Total Files

3

Last publish

Collaborators

  • shannonmoeller