0.0.8 • Published 6 years ago
memi v0.0.8
MEMI
Simple task-runner with JavaScript.
MEMI is simple task-runner, inspired by mimorisuzuko/memi.
- Write tasks with JavaScript
- Auto install dependencies
Install
npm i -g memi
# When you install via yarn, you should install `npm` too.
yarn global add npm memi
Usage
- Put Memifile on working directory
- MEMI loads Memifile named as below
Memifile
/.memifile
Memifile.{js,mjs}
/.memifile.{js,mjs}
- MEMI loads Memifile named as below
Write task functions as module
See example
import inquirer from 'inquirer'; import cowsay from 'cowsay'; export default { async start() { const { text } = await inquirer.prompt([ { name: 'text', message: "How's it going?", }, ]); this.echo(text); }, echo(text = 'Hello Memi!') { console.log(cowsay.say({ text })); }, };
Run task
memi <taskname> [<args>...]
Tips: Useful libraries when you write tasks
- execa - npm
- A better
child_process
- A better
- fs-extra - npm
- Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
- shelljs - npm
- Portable Unix shell commands for Node.js
- simple-git - npm
- A light weight interface for running git commands in any node.js application.
- glob - npm
- Match files using the patterns the shell uses, like stars and stuff.
- opn - npm
- A better node-open. Opens stuff like websites, files, executables. Cross-platform.
- inquirer - npm
- A collection of common interactive command line user interfaces.
Note
- Auto-installed dependencies are in
$HOME/.memi/node_modules
.- For Windows:
%USERPROFILE%\.memi\node_modules
.
- For Windows:
Contribute
PRs accepted.
What's MEMI?
MEMI have been named after Memi Kakizaki (柿崎芽実).
License
MIT © 3846masa