
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@fnet/npm-list-versions
Advanced tools
This project provides a simple utility to retrieve and manage the version history of a specified npm package. It allows users to efficiently view all versions of a package available on the npm repository, and provides options for grouping these versions b
This project provides a simple utility to retrieve and manage the version history of a specified npm package. It allows users to efficiently view all versions of a package available on the npm repository, and provides options for grouping these versions based on major, minor, or patch-level changes.
The tool fetches the version list of a specified npm package directly from the npm registry using the npm view command. The results are then processed to provide a neat, reverse-sorted list of all available versions. If required, the versions can also be grouped by major, minor, or patch releases to better analyze the release pattern.
The @fnet/npm-list-versions utility offers a straightforward way to examine and categorize npm package versions, providing clarity and insight into the update history of any selected package. This can be especially helpful for developers seeking to understand version progression or determine compatibility with different versions.
The @fnet/npm-list-versions library is a helpful tool for developers who need to retrieve and organize version information for npm packages. This library allows you to list all available versions of a specified npm package and provides options to sort and group them by major, minor, or patch numbers. It also enables filtering out pre-release versions, providing you with a clean version history for your package management tasks.
You can install the @fnet/npm-list-versions library using either npm or yarn. Simply run one of the following commands in your terminal:
npm install @fnet/npm-list-versions
or
yarn add @fnet/npm-list-versions
Here's how you can use @fnet/npm-list-versions to fetch and organize package version information:
To get a list of all stable versions of a package, you can simply call the exported index function with the package name:
import listVersions from '@fnet/npm-list-versions';
(async () => {
try {
const versions = await listVersions({ name: 'express' });
console.log(versions);
} catch (error) {
console.error(error.message);
}
})();
If you want to exclude pre-release versions, ensure your call does not specify the prerelease option or sets it to false (which is the default behavior).
You can group versions by major, minor, or patch numbers by setting the corresponding options:
import listVersions from '@fnet/npm-list-versions';
(async () => {
try {
// Group by major version numbers
const groupedByMajor = await listVersions({
name: 'react',
groupBy: { major: true }
});
console.log(groupedByMajor);
// Group by minor version numbers
const groupedByMinor = await listVersions({
name: 'react',
groupBy: { minor: true }
});
console.log(groupedByMinor);
} catch (error) {
console.error(error.message);
}
})();
(async () => {
try {
const versions = await listVersions({ name: 'lodash' });
console.log('All Stable Versions of Lodash:', versions);
} catch (error) {
console.error('Error:', error.message);
}
})();
(async () => {
try {
const versions = await listVersions({
name: 'vue',
groupBy: { major: true }
});
console.log('Versions Grouped by Major:', versions);
} catch (error) {
console.error('Error:', error.message);
}
})();
The @fnet/npm-list-versions library uses shelljs for executing shell commands and semver for version comparison and sorting, making it easier to handle version strings effectively.
$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
name:
type: string
description: The name of the npm package to query for versions.
groupBy:
type: object
properties:
major:
type: boolean
default: false
description: Group versions by major version.
minor:
type: boolean
default: false
description: Group versions by minor version.
patch:
type: boolean
default: false
description: Group versions by patch version.
description: Options for grouping versions.
prerelease:
type: boolean
default: false
description: Include prerelease versions in the results.
required:
- name
FAQs
This project provides a simple utility to retrieve and manage the version history of a specified npm package. It allows users to efficiently view all versions of a package available on the npm repository, and provides options for grouping these versions b
We found that @fnet/npm-list-versions demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.