ShellCheck - A shell script static analysis tool.
Downloads the most recent version of koalaman's ShellCheck.
Warning: Node.js version
>= 18.4.0 || >= 16.17.0
is required
npm install --save-dev shellcheck
Note: On first execution
shellcheck
it's automatically downloaded
Note: It's recommended to execute
shellcheck
usingnpx
Note: By default, all GitHub requests are anonymous. If you encounter error
403 | rate limit exceeded
(e.g., in CI), set the environment variableGITHUB_TOKEN
to use your own personal access token
Execute shellcheck
directly from your npm scripts:
{
"scripts": {
"lint": "npx shellcheck path/to/script.sh"
}
}
Note: More functions, utilities, and constants are available
import { shellcheck, download, config } from 'shellcheck';
/**
* Spawn ShellCheck.
* Download ShellCheck if not found or invalid.
*/
await shellcheck({
// Options..
});
/**
* Download ShellCheck.
*/
await download({
destination: `path/to/destination/shellcheck`
// destination: `path/to/destination/${config.bin}` // Platform-dependent name (add .exe on Windows)
// Options...
});
Note:
Platform
andArchitecture
follow Node.js naming convention
Platform | Architecture | Notes |
---|---|---|
linux |
arm64 |
|
linux |
x64 |
|
darwin |
x64 |
|
darwin |
arm64 |
Rosetta 2 must be installed. There is no native binary for darwin arm64 at the moment (see this). As a result, the downloaded binary is for x64 , and Rosetta 2 translates it to operate with Apple Silicon . |
win32 |
x64 |
I would love to see your contribution ❤️
See CONTRIBUTING guidelines.
This project is licensed under the MIT License.
See LICENSE file for details.