Socket
Socket
Sign inDemoInstall

@namchee/dependent

Package Overview
Dependencies
54
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

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 🚀


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

v0.2.0 (Sat Jul 31 2021)

🚀 Enhancement
  • feat: Add TypeScript support #3 (@Namchee)
🐛 Bug Fix
  • fix: Use pop() instead of element access to get file extension #10 (@Namchee)
  • docs: Add pull request template #8 (@Namchee)
  • fix: Remove duplicate issue template #6 (@Namchee)
  • docs: Add issue templates #5 (@Namchee)
  • docs: Fix npm package scope badge #2 (@Namchee)
Authors: 1

Readme

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

Last updated on 30 Jul 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc