- A smart task-runner for JSer
- Write tasks as ES module
- Auto-install dependencies!!
Why create a new task-runner?
Inspired by mimorisuzuko/memi (Japanese).
This requires the following:
- Can use it anywhere; I would like to avoid putting
package.jsonin a non-Node.js working directory.
- Put the dependencies in a directory except
npm root -g; it is not cool to install them globally.
Issues of existing task-runners
Shell Script is difficult, e.g. in Windows, it is troubling to install a make command.
I hate to put
package.json in a non-Node.js working directory.
Although dependencies of gulp should be installed globally or locally, I hate to put
node_modules in a non-Node.js working directory and to install dependencies to
npm root -g.
MEMI, a smart task-runner
First, you define tasks via
Or, you can use a named exports.
Also, you can write as CommonJS．
memi <taskname> allows you to run the task. For example, if you would like to run a build task, you should type
Then, MEMI finds up
Memifile.js recursively. So MEMI can work on subdirectories.
In the other words, if you want to run MEMI anywhere, you should put
Memifile.js in a home directory.
When you pass arguments as
memi <taskname> arg1 arg2 ..., the task function receives as function arguments. Also, MEMI allows you to use node modules for CLI (e.g. Inquirer).
It is notable that MEMI will install dependencies automatically! For example, when you write
Memifile.js as the above, MEMI installs
A directory whre the dependencies are installed by MEMI is
%USERPROFILE%\.memi, and thus you don't have to install the dependencies globally nor locally.
Memifile.js in the home directory, you can use MEMI anywhere.
MIME is the task-runner that can be used casually and in full swing.
BTW: Medium API and MEMI
I wrote this article in markdown via VSCode, and I posted it from Medium API via
When I type
memi medium filename.md, the article is posted via Medium API, and then the draft URL opens.
This is very simple code, but re-usable thanks to MEMI.