зеркало из https://github.com/microsoft/just.git
560caa2639
* Update typescript and eslint, and run prettier * update deps * Change files * revert arrow parens |
||
---|---|---|
.. | ||
README.md | ||
args.md | ||
composition.md | ||
condition.md | ||
logging.md | ||
thunk.md |
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
- Install
ts-node
andtypescript
:
npm i -D ts-node typescript
- 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!