Translucent opinionated scripts runner.
jako is a minimalist toolbelt choice for monorepo projects compatible with whatever languages you are using.
[ Getting started 🤓 | Check it on NPM 👌 ]
-
Zero setup: There is no need to configure jako, and setting it up is as easy as moving your current scripts to a folder.
-
Polyglot: You are free to write your scripts using any language you want.
-
Translucent: Forget about build tools that force you to write code that only work for that specific runner. As a principle, all the scripts run by jako need to be executable also without jako. No vendor lock, less API to keep track of.
-
Extensible and modular: jako doesn't hold you back while your project is growing. Encapsulate as many independent projects as you want in a single repo and jako will let you run all your scripts from a centralized place.
The name jako
comes from "JAKe + Opinionated".
Jake is the JavaScript build tool for NodeJS. Jake has been around since the very early days of Node, and is very full featured and well tested.
In essence, jako is just a tiny but powerful wrapper around jake. Under the hood, jako combines the maturity of a battle-tested codebase with a modern architecture.
You can install it from one of these 3 options:
$ npm install -g jako
$ yarn global add jako
you may also install it as a development dependency in a package.json file:
// package.json
"devDependencies": {
"jako": "latest"
}
Then install it with either npm install
or yarn install
jako [options ...] [env variables ...] target
for the full list of available options
, please check jake's options.
Let's create our first script together! To do so, let's imagine you want to have a script that clears all the node_modules
folders in your repo.
- create a
/scripts/clean
folder and create a file namednode_modules.sh
inside it:
$ mkdir -p scripts/clean
$ printf "#\!/bin/bash\nfind . \( -type d -name 'node_modules' \) -exec rm -rf '{}' +" > scripts/clean/node_modules.sh
- give it permission to run:
$ chmod +x **/*.sh
- run it!
# both calls below should be equivalent:
$ jako clean:node_modules
# or
$ cd ./scripts/clean ; ./node_modules.sh
# running `jako` with no arguments will list the available tasks
$ jako
Keep in mind that you can create scripts
folder anywhere you want in your project and jako will adapt to it.
Nesting scripts
folders deep inside your project is not only possible but recommended!
- always add shebang to your scripts.
- always give your scripts permission to run:
chmod +x file-path.ext
- jako will always call your scripts from the directory they are placed in, but not all runners will do that for you. If you, i.e, execute a bash script as
./scripts/clean/node_modules.sh
instead ofcd ./scripts/clean ; ./node_modules.sh
, that could remove folders in different places than the ones you expected. That's why we encourage you to enforce a standardizedcwd
for all your scripts. In bash you can do that by appendingdirname "$0"
to the top of your scripts.
This project is sponsored by feats.
Join a community of people helping each other get credit for their roles in projects.
From developing products and apps to architecture and campaigns.
Jako's logo illustration credit: www.vecteezy.com