Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
query-registry
Advanced tools
Query the npm registry for packuments, manifests, packages and download counts
Weekly downloads
Changelog
[2.6.0] - 2022-08-13
gitRepository
property may change with respect to previous releasesgit-url-parse
Readme
This package exports several functions to query the npm registry (or one of its mirrors) through one of its endpoints.
Using npm
:
npm i query-registry
Using yarn
:
yarn add query-registry
Get the metadata for the npm registry:
import { getRegistryMetadata } from 'query-registry';
(async () => {
const metadata = await getRegistryMetadata();
// Output: 'registry'
console.log(metadata.db_name);
})();
Get the latest manifest for package query-registry
from the npm registry:
import { getPackageManifest } from 'query-registry';
(async () => {
const manifest = await getPackageManifest({ name: 'query-registry' });
// Output: 'query-registry'
console.log(manifest.name);
})();
Get the abbreviated packument for package query-registry
from the npm registry:
import { getAbbreviatedPackument } from 'query-registry';
(async () => {
const packument = await getAbbreviatedPackument({ name: 'query-registry' });
// Output: 'query-registry'
console.log(packument.name);
})();
Get the weekly downloads for package query-registry
from the npm registry:
import { getPackageDownloads } from 'query-registry';
(async () => {
const downloads = await getPackageDownloads({ name: 'query-registry' });
// Output: 'query-registry'
console.log(downloads.package);
// Output: 'number'
console.log(typeof downloads.downloads);
})();
Get the search results for text query query-registry
from the npm registry:
import { searchPackages } from 'query-registry';
(async () => {
const results = await searchPackages({
query: { text: 'query-registry' },
});
// Output: 'query-registry'
console.log(results.objects[0].package.name);
})();
Debug messages are available in non production environments when the DEBUG
environment variable is set to query-registry
:
DEBUG="query-registry"
For more information, see the debug package.
MIT License
Copyright (c) 2021 Edoardo Scibona
See LICENSE file.
FAQs
Query the npm registry for packuments, manifests, packages and download counts
The npm package query-registry receives a total of 13,334 weekly downloads. As such, query-registry popularity was classified as popular.
We found that query-registry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.