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
79
Maintenance
100
Vulnerability
100
License
Rust (78.84%)
JavaScript (13.33%)
TypeScript (5.18%)
Handlebars (2.57%)
HTML (0.08%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
15,800,498
Last Day
4,932
Last Week
4,932
Last Month
746,783
Last Year
8,626,415
8,149 Stars
1,973 Commits
287 Forks
85 Watching
22 Branches
73 Contributors
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
Publised On
10 May 2024
Cumulative downloads
Total Downloads
Last day
0%
4,932
Compared to previous day
Last week
-97%
4,932
Compared to previous week
Last month
-3.7%
746,783
Compared to previous month
Last year
74.4%
8,626,415
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
28 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 8/9 approved changesets -- score normalized to 8
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
8 existing vulnerabilities detected
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
Score
Last Scanned on 2025-01-27
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