New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

unused-package

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unused-package - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

10

index.js

@@ -43,3 +43,6 @@ const directories = __dirname.split("/");

let packageName = statement.split("from")[1];
if (!packageName.trim().includes(".")) {
if (
!packageName.trim().includes("./") &&
!packageName.trim().includes("../")
) {
packageName = packageName

@@ -61,3 +64,6 @@ .replace('"', "")

let packageName = statement.split("require")[1];
if (!packageName.trim().includes(".")) {
if (
!packageName.trim().includes("./") &&
!packageName.trim().includes("../")
) {
packageName = packageName

@@ -64,0 +70,0 @@ .replace("(", "")

2

package.json
{
"name": "unused-package",
"version": "1.1.1",
"version": "1.1.2",
"description": "unused-package is a dependency analysing tool which lets you know which packages are not being used or if package is devDependency but installed as normal dependency",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -21,3 +21,3 @@ # unused-package

**create a file named unused.js with below code**
**create a file named unused.js in root directory with below code**

@@ -62,2 +62,13 @@ ```

**OR**
**create a seperate script to run unused.js file**
```
"scripts":{
"detect:unused:packages": " node unused.js"
}
```
**Note: Currently package is still in initial phase and if library returns and false positives please feel free to open an issue**
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