just/docs/tasks
Elizabeth Craig 560caa2639
Update dependencies and run prettier (#495)
* Update typescript and eslint, and run prettier

* update deps

* Change files

* revert arrow parens
2021-01-13 11:39:59 -08:00
..
README.md Update dependencies and run prettier (#495) 2021-01-13 11:39:59 -08:00
args.md Update dependencies and run prettier (#495) 2021-01-13 11:39:59 -08:00
composition.md Update dependencies and run prettier (#495) 2021-01-13 11:39:59 -08:00
condition.md Update dependencies and run prettier (#495) 2021-01-13 11:39:59 -08:00
logging.md Update dependencies and run prettier (#495) 2021-01-13 11:39:59 -08:00
thunk.md Docs switches to vuepress!! (#471) 2020-10-09 15:45:51 -07:00

README.md

id title sidebar_label
getting-started Getting Started with Just Getting Started

Just simplifies your life in managing build tasks. It stands on the shoulders of excellent and well tested libraries: undertaker, yargs, and plop.js. We encourage developers to make just-scripts available locally instead of installing just-scripts as a global tool.

npm i -D just-scripts

Defining Tasks

Place some task definitions inside just.config.js in your root folder (next to package.json):

// CommonJS style
const { task, option, logger, argv } = require('just-scripts');

option('name', { default: 'world' });

task('sayhello', function () {
  logger.info(argv().name);
});

Defining Tasks in Style with TypeScript

  1. Install ts-node and typescript:
npm i -D ts-node typescript
  1. Place tasks inside just.config.ts in your root folder (next to package.json):
// ES Module style
import { task, option, logger, argv } from 'just-scripts';

option('name', { default: 'world' });

task('sayhello', function () {
  logger.info(argv().name);
});

Run It!

Then run it! It is best to either place just inside a npm run script or run it with npx:

$ npx just sayhello
$ npx just sayhello --name me

That's all!