npm install @rauschma/scripts-help
Directory demo/ shows how to set up package.json. If you want to see the output of scripts-help in your terminal, you can clone this repository and:
cd scripts-help/
npm install
cd demo/
npm run help
If you do this, youβll see the font styles and colors that scripts-help uses (which, alas, canβt be shown via GitHubβs Markdown code blocks).
package.json:
{
"private": true,
"scripts": {
"help": "scripts-help -w 40",
"\n========== Building ==========": "",
"tsc": "tsc",
"tscwatch": "tsc --watch",
"\n========== Serving ==========": "",
"serve": "serve ./site/"
},
"scripts-help": {
"tsc": "Compile the TypeScript to JavaScript.",
"tscwatch": "Watch the TypeScript source code and compile it incrementally when and if there are changes.",
"serve": "Serve the generated website via a local server."
}
}Output of npm run (without arguments) inside demo/:
help
scripts-help -w 40
========== Building ==========
tsc
tsc
tscwatch
tsc --watch
========== Serving ==========
serve
serve ./site/
Output of npm run help inside demo/:
Package βdemoβ
ββββββββ€βββββββββββββββββββββββββββββββββββββββββββ
β help β node ../src/scripts-help.mjs -w 40 β
ββββββββ§βββββββββββββββββββββββββββββββββββββββββββ
Building
ββββββββββββ€βββββββββββββββββββββββββββββββββββββββββββ
β tsc β Compile the TypeScript to JavaScript. β
ββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ’
β tscwatch β Watch the TypeScript source code and β
β β compile it incrementally when and if β
β β there are changes. β
ββββββββββββ§βββββββββββββββββββββββββββββββββββββββββββ
Serving
βββββββββ€βββββββββββββββββββββββββββββββββββββββββββ
β serve β Serve the generated website via a local β
β β server. β
βββββββββ§βββββββββββββββββββββββββββββββββββββββββββ