Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@namchee/dependent

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@namchee/dependent

Simple utility CLI tool to analyze which files are using a Node dependency 🚀

  • 0.6.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Dependent

NPM package version Code Style: Google TypeScript Vulnerabilities

Dependent is a simple utility CLI to find out which files in your JavaScript project is using a certain dependency. 🚀

Why?

Say, you want to uninstall some dependency since it is not needed anymore in file x. You proceed to execute npm uninstall x, the uninstallation completed successfully, and then you continue the development. Sadly, you realized that x is actually imported by another files. Your project now breaks by your careless mistake.

The above scenario is fine for small projects since they are easier to test and execute (and compile, if you're using a superset of JavaScript). But, what about big projects where it took so long to execute and compile? What about dynamic imports in not-fully-tested projects where the code may fail silently? This utility aims to fix those issues.

Another use case is for new team member so they can analyze why and where a dependency is needed so the onboarding process can go faster.

Features

  • Parse JS files in your project.
  • Path configuration with [files...] argument.
  • Failsafe parsing with silent argument.
  • ESM and CommonJS compatibility.

Installation

You can install it globally with your favorite package manager. Below is the example of installation with npm.

npm install -g @namchee/dependent

Usage

The utility can be executed either with dependent or deps.

dependent <package> [files...]

Positionals:
  package, p  Package name to be analyzed.                              [string]
  files, f    Files to be analyzed in glob pattern relative to the current
              project directory.                              [string] [default:
          ["!(node_modules)/**/*.js","!(node_modules)/**/*.mjs","*.js","*.mjs"]]

Options:
      --help     Show help                                             [boolean]
      --version  Show version number                                   [boolean]
  -m, --module   Parse all files as ES module files                    [boolean]
  -r, --require  Parse all files as JS scripts                         [boolean]
  -s, --silent   Skip all unreadable and unparseable files instead of throwing
                 errors                               [boolean] [default: false]
  -t, --table    Print the output in table format     [boolean] [default: false]

License

This project is licensed under the MIT License.

FAQs

Package last updated on 01 Aug 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc