npm install entry point for CodeScan. CodeScan itself is a .NET 10 single-binary tool — this package is a thin wrapper that downloads the right prebuilt binary on
postinstalland forwards your CLI args to it.
# Windows / macOS / nvm-managed Node (no sudo needed)
npm install -g @webnori/codescan-cli
# Linux with system Node (apt/dnf/.pkg) — root-owned npm prefix
sudo npm install -g @webnori/codescan-cli
codescan --helpHeads up — the unscoped
codescan-cliname is NOT us. An unrelated third party registered the barecodescan-cliname on npm first. That package is broken (its own ESM/CJS mismatch crashes on launch) and has nothing to do with CodeScan. Always install the scoped name@webnori/codescan-cli. If you previously installed the wrong one, remove it withnpm uninstall -g codescan-cli.
Why
sudoon Linux? System-Node distros put npm's global prefix at/usr/local/lib/node_modules/(root-owned), so a non-rootnpm install -gfails withEACCESbefore postinstall can run.sudois the simplest answer; if you'd rather not, use nvm/fnm to put Node in your home dir, or skip npm entirely withScript/install.sh(installs to~/.local/bin/). Either way,~/.codescan/{db,logs,config}user data is never touched.
| OS | Architectures |
|---|---|
| Linux (glibc) | x64, arm64 |
| macOS | arm64 (Apple Silicon) |
| Windows | x64 |
All four shipped binaries (win-x64, linux-x64, linux-arm64, osx-arm64) are reachable from the npm wrapper — the postinstall picks the right one automatically.
On Windows, winget install psmon.CodeScan is still the recommended path (no Node.js required), but if you already have Node installed and prefer a single npm install -g line for your toolchain, this package works too.
musl/Alpine Linux and Intel Mac are v2 candidates.
postinstall (scripts/install.js) does the following:
- Detect OS + CPU arch → asset name like
codescan-linux-x64.tar.gz. - Fetch
https://github.com/psmon/CodeScan/releases/download/v<version>/<asset>. - Fetch
checksums.txtfrom the same release and verify SHA256. - Extract into
vendor/codescan/inside this package. bin/codescan.jscalls that binary with your args.
| Variable | Default | Purpose |
|---|---|---|
CODESCAN_VERSION |
package.json version |
Pin a different release |
CODESCAN_REPO |
psmon/CodeScan |
Use a fork |
CODESCAN_SKIP_DOWNLOAD |
unset | If 1, skip the binary download (e.g. for CI where you preinstall manually) |
HTTPS_PROXY, HTTP_PROXY |
— | Detected and warned about; v1 does not auto-route through proxy |
CodeScan stores its DB, logs, and config under ~/.codescan/. That directory
is never modified by install or uninstall — it survives upgrades and
package removal. npm uninstall -g @webnori/codescan-cli only removes the
vendored binary inside this package.
If your environment blocks postinstall network access:
# 1. Download the matching asset:
curl -LO https://github.com/psmon/CodeScan/releases/download/v<version>/codescan-linux-x64.tar.gz
# 2. Verify checksum:
curl -LO https://github.com/psmon/CodeScan/releases/download/v<version>/checksums.txt
sha256sum -c checksums.txt --ignore-missing
# 3. Extract somewhere on your PATH:
tar -xzf codescan-linux-x64.tar.gz -C ~/.local/bin --strip-components=1
~/.local/bin/codescan --versionMIT — same as CodeScan upstream.