@metaplex-foundation/rustbin
TypeScript icon, indicating that this package has built-in type declarations

0.3.5 • Public • Published

rustbin Build Lint and Test Rustbin

Synchronizes a Rust binary version with the related Rust crate.

Anchor Example

Prepare Config

const path = require('path');
const rootDir = path.join(__dirname, 'cargo');
const cargoToml = path.join(__dirname, '..', '..', 'program', 'Cargo.toml');

const config = {
  rootDir,
  binaryName: 'anchor',
  binaryCrateName: 'anchor-cli',
  libName: 'anchor-lang',
  dryRun: false,
  cargoToml,
};

Checking Versions

const { rustbinCheck } = require('@metaplex-foundation/rustbin');
const { satisfies, libVersion, binVersion } = await rustbinCheck({
console.log(`${binVersion} %s ${libVersion}`, satisfies ? 'satisfies' : 'does not satisfy');

Check and Install If Needed

const { rustbinMatch, confirmAutoMessageConsole } = require('@metaplex-foundation/rustbin');
const { cmd, fullPathToBinary } = await rustbinMatch(config, confirmAutoMessageConsole);
console.log(`${fullPathToBinary} installed via ${cmd}`);

API

Please consult the full API here.

LICENSE

Apache-2.0

Package Sidebar

Install

npm i @metaplex-foundation/rustbin

Weekly Downloads

10,459

Version

0.3.5

License

Apache-2.0

Unpacked Size

36.3 kB

Total Files

30

Last publish

Collaborators

  • danenbm
  • nhanphan
  • blockiosaurus
  • svc01-metaplex
  • brandontulsi