
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
shellcheck
Advanced tools
ShellCheck - A shell script static analysis tool.
Downloads the most recent version of koalaman's ShellCheck.
Warning: Node.js version
>= 18.12.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: Proxy support via
HTTP_PROXY
,HTTPS_PROXY
andNO_PROXY
environment variables
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"
}
}
Name | Values | Default | Description |
---|---|---|---|
SHELLCHECKJS_RELEASE | latest | v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*) | latest | Release version. See https://github.com/koalaman/shellcheck/releases |
SHELLCHECK_BIN | Any valid path to an executable binary file | linux or darwin: ./bin/shellcheck win32: .\bin\shellcheck.exe | ShellCheck executable binary path |
SHELLCHECKJS_LOGGER_LEVEL | off | debug | info | warn | error | info | Logger level |
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({
args: ['path/to/script.sh', 'path/to/another/script.sh']
// Options...
})
.then((result) => {
// Check error
if (result.error) throw result.error;
// Print stdout
if (result.stdout) console.log(result.stdout.toString('utf8'));
// Print stderr
if (result.stderr) console.error(result.stderr.toString('utf8'));
// Exit code
if (result?.status !== 0) throw new Error(`Exit code: ${result?.status}`);
})
.catch((err) => {
console.error(`Error: ${err}`);
throw err;
});
/**
* Download ShellCheck.
*/
await download({
destination: `path/to/destination/shellcheck`
// destination: `path\\to\\destination\\shellcheck.exe` // Windows
// Options...
});
Note:
Platform
andArchitecture
follow Node.js naming convention
Platform | Architecture |
---|---|
linux | x64 |
linux | arm64 |
darwin | x64 |
darwin | arm64 |
win32 | x64 |
I would love to see your contribution :heart:
See CONTRIBUTING guidelines.
This project is licensed under the MIT License.
See LICENSE file for details.
v3.1.0 - 2025-01-31
SHELLCHECKJS_BIN
binDir
configuration option. Configuration bin
now contains the complete path to the ShellCheck executable binary (including both binary directory and binary name)FAQs
Wrapper to download shellcheck
The npm package shellcheck receives a total of 28,999 weekly downloads. As such, shellcheck popularity was classified as popular.
We found that shellcheck demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.