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

depcheck

Package Overview
Dependencies
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depcheck

Check dependencies in your node module

  • 0.9.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
991K
increased by4.65%
Maintainers
2
Weekly downloads
 
Created

What is depcheck?

depcheck is a tool that helps you to find unused dependencies in your project. It scans your project files and identifies which dependencies are not being used, which can help you to clean up your package.json file and reduce the size of your project.

What are depcheck's main functionalities?

Check for unused dependencies

This feature allows you to check for unused dependencies in your project. You can specify options to ignore certain directories or dependencies that match specific patterns.

const depcheck = require('depcheck');

const options = {
  ignoreDirs: [
    'sandbox',
    'dist',
    'bower_components'
  ],
  ignoreMatches: [
    'grunt-*'
  ]
};

depcheck('/path/to/your/project', options, (unused) => {
  console.log(unused.dependencies); // an array containing the unused dependencies
  console.log(unused.devDependencies); // an array containing the unused devDependencies
});

Check for missing dependencies

This feature allows you to check for dependencies that are used in your project but are not listed in your package.json file.

const depcheck = require('depcheck');

depcheck('/path/to/your/project', {}, (unused) => {
  console.log(unused.missing); // a lookup containing the dependencies missing in package.json but used in the code
});

Check for invalid files

This feature allows you to identify files in your project that could not be parsed, which might indicate issues with those files.

const depcheck = require('depcheck');

depcheck('/path/to/your/project', {}, (unused) => {
  console.log(unused.invalidFiles); // a lookup containing the files that could not be parsed
});

Other packages similar to depcheck

Keywords

FAQs

Package last updated on 30 Jan 2020

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