async function

getDailyRegistryDownloads

(__namedParameters,[object Object]): Promise<DailyRegistryDownloads>
getDailyRegistryDownloads returns the number of downloads for all registry packages for each day in a given time period.

Examples

Get the day by day weekly downloads for the npm registry:
import { getDailyRegistryDownloads } from 'query-registry';

(async () => {
    const downloads = await getDailyRegistryDownloads();

    // Output: 'number'
    console.log(typeof downloads.downloads[0].downloads);
})();
Get the day by day monthly downloads for the npm registry:
import { getDailyRegistryDownloads } from 'query-registry';

(async () => {
    const downloads = await getDailyRegistryDownloads({ period: 'last-month' });

    // Output: 'number'
    console.log(typeof downloads.downloads[0].downloads);
})();