Huge News!Announcing our $40M Series B led by Abstract Ventures.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.0.3 to 1.0.4

2

package.json
{
"name": "unused-package",
"version": "1.0.3",
"version": "1.0.4",
"description": "",

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

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

const traverseDirectories = async (source) => {
const data = await fs.promises.readdir(source, { withFileTypes: true });
const isSourceFile = fs.lstatSync(source).isFile();
const data = isSourceFile
? [{ isDirectory: () => false, name: source }]
: await fs.promises.readdir(source, { withFileTypes: true });

@@ -27,3 +30,5 @@ for (let i = 0; i < data.length; i++) {

) {
const path = `${startingPath}/${source}/${file.name}`;
const path = isSourceFile
? `${startingPath}/${source}`
: `${startingPath}/${source}/${file.name}`;
const fileData = fs.readFileSync(path, "utf-8");

@@ -118,3 +123,1 @@ const codeLines = fileData.split("\n");

module.exports = findUnUsedPackages;
//todo accept entry as file
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