npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-modules-dependencies-extractor

v0.1.1

Published

Extracts dependencies from the node_modules folder, to a reference format. This reference format is a JSON file containing arrays of objects with keys name and version.

Downloads

34

Readme

node-modules-dependencies-extractor

Description

Extracts dependencies from the node_modules folder of a Javascript project, to a reference format. This reference format is a JSON file containing arrays of objects with keys name and version. The node_modules folder is assumed to have been generated by one of the following commands: npm install or yarn install.

Outputs the following files:

  • dependencies_from_node_modules.json (name can be overriden) contains the dependencies as identified in the node_modules folder, in a reference format. This reference format is a JSON file containing arrays of objects with keys name and version. It contains unique objects by the combination name and version

Status

0.1.1, see CHANGELOG.md

Limitation

  • tested with the node_modules folder of various Javascript projects, as generated by the install command of the following package managers:
    • yarn
    • npm

Prerequisites

In order to run this project, you should have installed:

  • Node installed (we used node v12.2.0)
  • yarn (we used version v1.19.0) The input to this script should be a folder named node_modules, as generated by the install commands of either npm or yarn .

Installation

Install globally:

npm install -g node-modules-dependencies-extractor

Or you could use it without installing by running:

npx node-modules-dependencies-extractor [options]

Usage

extract-nm-dependencies [options]

Supported options:

| Flag | Alias | Functionality | ---------------------|:-----:| ------------------------------------- | --input [path] | -i | (mandatory) specifies path to the node_modules folder. | --output [filename] | -o | (optional) Filename to which the list of dependencies (name+version) is written (json format). If the file already exists, it will be overwritten. Default value: dependencies_from_node_modules.json | --verbose | | Verbose output of commands and errors | --help | -h | Displays usage information | --version | -v | Displays version number

Sample usage

yarn extract-nm-dependencies -i ./test-data/node_modules_samples/siblings_no_nesting

Technology stack

  • Javascript
  • This software is intended to be used standalone, as a command-line tool

How to build

Get the sources locally; in a command line, go to the root folder of this project and execute:

yarn install

How to test

yarn test

or

yarn coverage

How to do static analysis of code

Automatically enabled: standard

yarn lint

Owners

See CODEOWNERS

Maintainers

See MAINTAINERS.md

Contributing

See CONTRIBUTING.md

License

See LICENSE.md

Author

Sanda Contiu

Keywords

  • dependencies
  • sbom
  • software bill of material
  • node_modules
  • npm
  • yarn