npmgen-core
The library behind npmgen.
It generates the npm publish tree that ships a prebuilt Rust binary.
The tree is a meta package plus one package per platform, wired through optionalDependencies and npm os/cpu filters.
The npmgen command-line tool is a thin wrapper over this crate.
Usage
Add it as a dependency:
cargo add npmgen-core
Drive a generation through the builder:
use Generator;
builder
.manifest_path
.out
.no_build
.build
.run?;
Package identity is read from the target crate with cargo metadata.
Targets, payload, and foreign manifests come from [package.metadata.npmgen], documented in the main README.
Key types
Generatorbuilds and runs a generation;GeneratorBuilderconfigures it.Projectis the resolved target crate;Configis its npmgen metadata.Targetis one resolved platform;TargetResolverderives the set.BuildDriveris the build seam, withCargoDriveras the default.
License
MIT. See LICENSE.