Gathering detailed insights and metrics for cargo-cp-artifact
Gathering detailed insights and metrics for cargo-cp-artifact
Gathering detailed insights and metrics for cargo-cp-artifact
Gathering detailed insights and metrics for cargo-cp-artifact
Rust bindings for writing safe and fast native Node.js modules.
npm install cargo-cp-artifact
Typescript
Module System
Node Version
NPM Version
99.7
Supply Chain
97.4
Quality
78.2
Maintenance
100
Vulnerability
100
License
Rust (78.66%)
JavaScript (13.56%)
TypeScript (5.13%)
Handlebars (2.58%)
HTML (0.07%)
Total Downloads
21,709,499
Last Day
13,439
Last Week
377,950
Last Month
1,646,551
Last Year
12,499,301
Apache-2.0 License
8,277 Stars
1,991 Commits
288 Forks
83 Watchers
24 Branches
73 Contributors
Updated on Jul 02, 2025
Minified
Minified + Gzipped
Latest Version
0.1.9
Package Id
cargo-cp-artifact@0.1.9
Unpacked Size
12.00 kB
Size
4.82 kB
File Count
6
NPM Version
10.7.0
Node Version
21.7.3
Published on
May 10, 2024
Cumulative downloads
Total Downloads
Last Day
-12.4%
13,439
Compared to previous day
Last Week
-7.8%
377,950
Compared to previous week
Last Month
5.7%
1,646,551
Compared to previous month
Last Year
121.4%
12,499,301
Compared to previous year
1
cargo-cp-artifact
is a small command line utility for parsing cargo metadata output and copying a compiler artifact to a desired location.
1npm install -g cargo-cp-artifact
cargo-cp-artifact --artifact artifact-kind crate-name output-file -- wrapped-command
cargo-cp-artifact
accepts a list of crate name and artifact kind to output file mappings and a command to wrap.cargo-cp-artifact
will read stdout
of the wrapped command and parse it as cargo metadata. Compiler artifacts that match arguments provided will be copied to the target destination.
When wrapping a cargo
command, it is necessary to include a json
format to --message-format
.
Multiple arguments are allowed to copy multiple build artifacts.
--artifact
Alias: -a
Followed by three arguments: artifact-kind crate-name output-file
--npm
Alias: -n
Followed by two arguments: artifact-kind output-file
The crate name will be read from the npm_package_name
environment variable. If the package name includes a namespace (@namespace/package
), the namespace will be removed when matching the crate name (package
).
Valid artifact kinds are bin
, cdylib
, and dylib
. They may be abbreviated as b
, c
, and d
respectively.
For example, -ac
is the equivalent of --artifact cdylib
.
1cargo-cp-artifact -a cdylib my-crate lib/index.node -- cargo build --message-format=json-render-diagnostics
1cargo-cp-artifact -a cdylib my-crate lib/index.node -- cat build-output.txt
npm
scriptpackage.json
1{ 2 "name": "my-crate", 3 "scripts": { 4 "build": "cargo-cp-artifact -nc lib/index.node -- cargo build --message-format=json-render-diagnostics" 5 } 6}
1npm run build 2 3# Additional arguments may be passed 4npm run build -- --feature=serde
At the time of writing, cargo
does not include a configuration for outputting a library or binary to a specified location. An --out-dir
option exists on nightly, but does not allow specifying the name of the file.
It's surprisingly difficult to reliably find the location of a cargo compiler artifact. It is impacted by many parameters, including:
However, cargo
can emit metadata on stdout
while continuing to provide human readable diagnostics on stderr
. The metadata may be parsed to more easily and reliably find the location of compiler artifacts.
cargo-cp-artifact
chooses to wrap a command as a child process instead of reading stdin
for two reasons:
-o pipefile
when integrating with build tooling which may need to be platform agnostic.npm
script.No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
14 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 15/16 approved changesets -- score normalized to 9
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
12 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More