📅  最后修改于: 2022-03-11 15:04:16.534000             🧑  作者: Mango
let package_name = 'svelte';
let download_count = 0;
$: fetch('https://api.npmjs.org/downloads/point/last-week/' + package_name)
.then(response => response.json())
.then(data => download_count = data.downloads || 0);
// Updating `package_name` will asynchronously update `download_count`