34 releases

0.4.13 Jun 3, 2023
0.4.9 Apr 10, 2023
0.4.6 Jan 9, 2023
0.4.3 Dec 21, 2022
0.3.0 Jul 2, 2022

#147 in Build Utils

Download history 6/week @ 2024-02-23 188/week @ 2024-03-01 37/week @ 2024-03-08 7/week @ 2024-03-15 155/week @ 2024-03-29

361 downloads per month
Used in rust-to-npm-cli

MIT license

13KB
300 lines

rust-to-npm

The Rust crate for rust-to-npm.

Methods

use rust_to_npm:create_package;

fn main() {
    // colocates a package.json that matches Cargo.toml 1:1
    let package = create_package(None, "Cargo.toml");

    println!("{:?}", package);
}

Output:

{
  "name": "rust-to-npm",
  "version": "0.4.10",
  "description": "ship a rust project to npm on all operating systems leveraging cargo.",
  "main": "start.js",
  "directories": {
    "test": "tests"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "postinstall": "node ./pre-install.js",
    "uninstall": "node ./uninstall.js"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/a11ywatch/rust-to-npm.git"
  },
  "keywords": ["rust-to-npm", "deploy-rust", "npm", "rust"],
  "author": "Jeff Mendez",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/a11ywatch/rust-to-npm/issues"
  },
  "homepage": "https://github.com/a11ywatch/rust-to-npm",
  "files": [
    "pre-install.js",
    "start.js",
    "uninstall.js",
    "README.md",
    "LICENSE"
  ]
}

Dependencies

~0.6–1.2MB
~27K SLoC