(package quick run)
Runs package.json scripts without Node and npm overhead.
Note
If you have Deno available, deno task
can do this too.
$ time npm run echo test
> echo
> echo test
test
real 0m0.479s
user 0m0.249s
sys 0m0.076s
$ time pqr echo test
test
real 0m0.007s
user 0m0.001s
sys 0m0.000s
A prebuilt executable is available for x86-64-v3 Linux on the Releases page. You can:
-
audit the repository at the tagged version, then
Then install the executable somewhere on your PATH, e.g. as root:
install -t /usr/local/bin/ ./pqr
sha256sum --tag /usr/local/bin/pqr # make sure it's still the same
-
pqr runs only the specified script; npm also runs scripts with
pre
andpost
prefixes if they exist (as long asignore-scripts
is off). Use[pqr prescript && ]pqr script[ && pqr postscript]
for compatibility. -
pqr doesn’t support workspaces yet.
-
pqr runs the script with an unmodified environment; npm adds several of its own strings. (See
npm run-script env
.) -
pqr requires
sh
; npm will use%ComSpec%
orcmd
on Windows. -
pqr doesn’t include npm’s
node-gyp-bin
inPATH
(because it doesn’t require npm to exist); find the directory withdirname "$(npm run -- env which node-gyp)"
and runPATH=node-gyp-bin:$PATH pqr …
for near-compatibility. -
npm provides default definitions for:
env
(env
)start
whenserver.js
exists (node server.js
)restart
(npm stop --if-present && npm start
)
pqr doesn’t.
-
pqr rejects
package.json
s with duplicate definitions of the top-levelscripts
key or of individual scripts; npm uses the last definition of any key, likeJSON.parse
. -
pqr uses the nearest
package.json
it finds along the current path (./package.json
,../package.json
,../../package.json
, …). npm uses a prefix consistent across all commands: the nearest directory containing either apackage.json
or anode_modules
after first removing allnode_modules
components from the end of the current path.This can only cause pqr to run a script in a situation where npm would have errored out.
- pqr adds arguments to the end of script commands with
"$@"
; npm double-quoted each argument after escaping only double quotes until version 7. (For example,npm run-script script -- '\"; yes #'
would executeyes
.)
Create an npm wrapper that delegates to pqr if its first argument is run-script
or run
, and the original npm otherwise; add it to your PATH
before the original npm.
zig version
0.14.0
zig ld.lld --version
LLD 19.1.7 (compatible with GNU linkers)
zig build -Drelease -Dcpu=x86_64_v3
objcopy --remove-section=.comment zig-out/bin/pqr
sha256sum --tag zig-out/bin/pqr
SHA256 (zig-out/bin/pqr) = (same as prebuilt pqr)
Verify GitHub’s attestation that the build was reproduced by GitHub Actions:
gh attestation verify \
--signer-digest="$(git rev-parse HEAD)" \
--deny-self-hosted-runners \
--source-digest="$(git rev-parse HEAD)" \
--repo=charmander/pqr \
./pqr
-
Also download SHA256SUMS and SHA256SUMS.sig from the same release
-
Verify the signature against the author’s signing key:
ssh-keygen -Y verify \ -f allowed-signers \ -n file \ -I '[email protected]' \ -s SHA256SUMS.sig \ <SHA256SUMS
Good "file" signature for [email protected] with …
-
Check the comment in SHA256SUMS to ensure that the signed version is what the release page claims it is
-
Check the hash:
sha256sum -c SHA256SUMS
pqr: OK