pliz
v0.6.0
Published
A minimalistic task router for Node.
Downloads
2
Readme
Pliz is a cli tool that invokes JS functions (typically development, build, or deploy tasks).
Pliz can be supercharged with Google's zx for more shell power.
So when calling:
pliz bump minor
This function will be called:
// plizers.js
import { $ } from 'zx';
export async function bump([versionType]) {
await $`npm version ${versionType}`;
await $`git push`;
await $`git push --tags`;
}
Rationale
Modern Javascript projects involve a multitude of development tasks. Typically these live in:
package.json
script commands, possible issues with which:- shell rather than JS
- no comments
- sometimes require extra dependencies (eg,
cross-env
) - parametrisation can be tricky
scripts
folder- onboarding and discoverability may be sub-optimal
- Our heads
- What's the command to kill a process? Do everyone remember
-9
? What about Windows? - What's the command to enter a docker image interactive shell again?
- What's the command to kill a process? Do everyone remember
Pliz reduces the team's cognitive load by offering a single source of truth to all these.
Quick Start
1. Install
npm i -g pliz
2. Create plizers
Create the following plizers.js
file (or plizers/index.js
) in your project root:
const say = ([text]) => {
console.log(`${text}!`);
};
module.exports = {
say,
};
yarn add --dev @babel/core @babel/register @babel/preset-env
pliz.config.js
:
require('@babel/register')({
presets: [
[
'@babel/preset-env',
{
targets: { node: 'current' },
},
],
],
});
plizers.js
:
export const say = ([text]) => {
console.log(`${text}!`);
};
3. Use
In your shell:
pliz say Hello