Crates.io | npm-package |
lib.rs | npm-package |
version | 0.2.0 |
source | src |
created_at | 2023-01-31 20:15:04.72143 |
updated_at | 2023-01-31 20:28:49.217622 |
description | A simple client for fetching metadata from the npm package |
homepage | |
repository | |
max_upload_size | |
id | 772935 |
size | 35,591 |
A very light-weight sync and async client for fetching metadata from the npm registry for a npm package.
These examples come from our examples folder
use npm_package::AsyncNpmClient;
use tokio;
#[tokio::main]
async fn main() {
let client = AsyncNpmClient::new();
let is_wsl_package = client.get("is-wsl").await.unwrap();
println!(
"Description of is-wsl from the npm registry: {}",
is_wsl_package.description
);
}
use npm_package::SyncNpmClient;
fn main() {
let client = SyncNpmClient::new();
let package = client.get("is-interactive").unwrap();
let version_history = package.versions.keys().collect::<Vec<_>>();
println!("All is-interactive releases on npm: {:?}", version_history);
}