Maid enables you to write your tasks in Markdown. Create a maidfile.md
or a README.md
then add Headers to list out your tasks with codeblocks including the tasks to run. This lesson walks you through creating a few tasks in either a maidfile.md
or a README.md
and how to execute the tasks from the command line.
Install:
npm install maid --save-dev
Create a maidfile.md
## hello```bashecho "hi"```
Then run:
npx maid hello
-----
A more realworld example can be that we can use maid to run build process
Install:
npm i -D parcel
## build```bashnpx parcel build index.html```## dev```bashnpx parcel index.html```
npx maid buildnpx maid dev
----
We can also run another task before or after the build task:
## buildRun task `start`.Run task `end` after.```bashnpx parcel build index.html```## dev```bashnpx parcel index.html```## start```jsconsole.log("task start")```## end```jsconsole.log("task end")```
---
Add description for the tasks:
## buildThis build the projectRun task `start`.Run task `end` after.```bashnpx parcel build index.html```## devThis is for development```bashnpx parcel index.html```## startThis run before the build```jsconsole.log("task start")```## endThis run after the build```jsconsole.log("task end")```
Run:
npx maid help
----
Using README.md:
in README file, we just need to add
Before the tasks we want to run, and all those tasks should have "###".
# DEMOs * mdx-deck *react-live *maid## Tasks ### buildThis build the projectRun task `start`.Run task `end` after.```bashnpx parcel build index.html```### devThis is for development```bashnpx parcel index.html```### startThis run before the build```jsconsole.log("task start")```### endThis run after the build```jsconsole.log("task end")```