task-library
v0.274.0
Published
A collection of bash scripts to support build, test, deploy and chores associated with developing and maintaining Node apps.
Downloads
56
Readme
Task Library
A collection of bash scripts to support build, test, deploy and chores associated with developing and maintaining Node apps.
Table of Contents
Install
https://www.npmjs.com/package/task-library
npm install task-library
Usage
npx task [TASK_NAME] [OPTIONS]
Try npx task vars
and npx task tasks
to list variables and tasks respectively.
Overriding variable defaults
To override the default value of any variable listed by npx task vars
, simply create a shell script named task-vars
in the package root directory and export those variables with the desired values, e.g.
#!/bin/bash
export NODE_VERSION="20.0.0"
To obtain the default value for any variable, invoke a function of the same name, e.g.
#!/bin/bash
echo $(NODE_VERSION)
Tasks
install
Installs NPM packages based on inference (to be elaborated).
update / upgrade / latest
Updates all NPM packages to the latest version regardless of semver.
configure / config
Generates config files based on inference (to be elaborated).
test
Runs tests using inferred test runner.
test-watch
Runs tests in watch mode using inferred test runner.
cov
Runs tests with code coverage using inferred test runner.
lint
Runs lint using inferred linters.
Currently supports ESLint and Shellcheck.
fix
Runs lint with fix option using inferred linters.
start / run
Starts the application using inferred launcher.
Currently supports Nodemon (for console applications), Serve (for static websites) and Parcel (for single page apps).
build / dist
Creates a build based on inference (to be elaborated).
deploy / publish
Deploys application based on inference (to be eleborated).
Currently supports GitHub Pages, NPM packages and Serverless.
pre-commit / pre
Runs config, code-gen, lint, cov, sloc, metrics-summary, readme (to be eleborated).
Developer Notes
find -exec
does not return exit code of exec command. Workaround: Usexargs
instead.