npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

shellcheck

v3.0.0

Published

Wrapper to download shellcheck

Downloads

203,328

Readme

shellcheck

ci codeql

ShellCheck - A shell script static analysis tool.

Downloads the most recent version of koalaman's ShellCheck.

Installation

Warning: Node.js version >= 18.12.0 is required

npm install --save-dev shellcheck

Usage

Note: On first execution shellcheck it's automatically downloaded

Note: It's recommended to execute shellcheck using npx

Note: Proxy support via HTTP_PROXY, HTTPS_PROXY and NO_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 variable GITHUB_TOKEN to use your own personal access token

Execute shellcheck directly from your npm scripts:

{
  "scripts": {
    "lint": "npx shellcheck path/to/script.sh"
  }
}

Environment Variables

| 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 | | SHELLCHECKJS_LOGGER_LEVEL | off | debug | info | warn | error | info | Logger level |

Programmatic

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/${config.bin}` // Platform-dependent name (add .exe on Windows)
  // Options...
});

Compatibility

Note: Platform and Architecture follow Node.js naming convention

| Platform | Architecture | | ------------ | ---------------- | | linux | x64 | | linux | arm64 | | darwin | x64 | | darwin | arm64 | | win32 | x64 |

Contributing

I would love to see your contribution :heart:

See CONTRIBUTING guidelines.

License

This project is licensed under the MIT License.
See LICENSE file for details.