mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 07:01:16 +00:00
chore: add scripts for helping with a release (#11832)
This commit is contained in:
parent
dccf4cbe36
commit
dce70d32a4
9 changed files with 475 additions and 35 deletions
22
tools/release/helpers/crates_io.ts
Normal file
22
tools/release/helpers/crates_io.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
export interface CratesIoMetadata {
|
||||
crate: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
versions: {
|
||||
crate: string;
|
||||
num: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export async function getCratesIoMetadata(crateName: string) {
|
||||
// rate limit
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
|
||||
const response = await fetch(`https://crates.io/api/v1/crates/${crateName}`);
|
||||
const data = await response.json();
|
||||
|
||||
return data as CratesIoMetadata;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue