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

deps

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deps - npm Package Compare versions

Comparing version 0.1.2 to 1.0.0

bin/.DS_Store

72

package.json
{
"author": "Zeus Lalkaka <lalkaka.zeus@gmail.com> (distracteddev.com)",
"name": "deps",
"description": "A executable tool that allows you to add/remove/view your current depedencies from the command line",
"version": "0.1.2",
"version": "1.0.0",
"description": "Node dependency usage checker using V8 Coverage",
"keywords": [
"node",
"dependency",
"usage",
"coverage",
"v8"
],
"files": [
"bin",
"dist"
],
"bin": {
"deps": "bin/deps.js",
"deps-start": "bin/deps-start.sh",
"deps-stop": "bin/deps-stop.sh"
},
"scripts": {
"build": "rm -rf dist && tsc -p src",
"dev": "npm run build -- -w",
"lint": "xo",
"version": "standard-version"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged && tsc -p src --composite false --noEmit",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"*.[tj]s": "xo --fix"
},
"repository": {
"url": ""
"type": "git",
"url": "git+https://github.com/privatenumber/deps.git"
},
"main": "deps",
"dependencies": {},
"devDependencies": {},
"optionalDependencies": {},
"engines": {
"node": "*"
"author": "Hiroki Osame <hiroki.osame@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/privatenumber/deps/issues"
},
"bin": {
"deps": "./deps"
"homepage": "https://github.com/privatenumber/deps#readme",
"dependencies": {
"chalk": "^4.1.0",
"cli-simple-table": "0.0.3",
"del": "^5.1.0",
"execa": "^4.0.1",
"minimist": "^1.2.5",
"read-pkg": "^5.2.0",
"sort-keys": "^4.0.0",
"tempy": "^0.5.0"
},
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@types/minimist": "^1.2.0",
"@types/node": "^14.0.13",
"husky": "^4.2.5",
"lint-staged": "^10.2.10",
"standard-version": "^8.0.0",
"typescript": "^3.9.5",
"xo": "^0.32.0"
}
}

83

README.md

@@ -1,32 +0,69 @@

---
## - deps -
#####The lazy-man's CLI npm dependency manager.
----
# 📦 deps <a href="https://npm.im/deps"><img src="https://badgen.net/npm/v/deps"></a> <a href="https://npm.im/deps"><img src="https://badgen.net/npm/dm/deps"></a> <a href="https://packagephobia.now.sh/result?p=deps"><img src="https://packagephobia.now.sh/badge?p=deps"></a>
###Local Installation ( for current directory only ):
<p align="center">
<img src="/.github/screenshot.png" width="70%">
<br>
Accurately detect which Node dependencies are in-use with V8 Coverage 🔥
</p>
#### Try it out!
```sh
$ npx deps [...command]
```
npm install deps
```
_eg. `npx deps npm run build`_
###Global Installation ( If you want to call it from anywhere ):
## :rocket: Install
Install globally if you don't want to use it via [npx](https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner).
```sh
npm i -g deps
```
npm install -g deps
```
## Usage:
###### Do not type the '$' in the following:
## Usage
### 🔬 Quick analysis
Prefix your Node command with `deps` and it will analyze and output the dependencies it used
```sh
$ deps ...
```
// Lists your dependencies, devDependencies and optionalDependencies
// as defined by your package.json.
$ deps
eg. `deps npm run build`
// Adding/Removing a dependency
$ deps {add,rm} {packageName} {packageVersion}
// Adding/Removing a devDependency
$ deps {add,rm} {packageName} {packageVersion} dev
// Adding/Removing a optionalDependency
$ deps {add,rm} {packageName} {packageVersion} opt
```
### 👩‍🔬 Analyzing dependency usage across commands
_Prerequisite: install `deps` globally_
1. Start recording dependecy usage (note the [dot-space](https://superuser.com/questions/1136409/what-is-the-dot-space-filename-command-doing-in-bash) at the beginning)
```sh
$ . deps-start
```
2. Run a series of Node scripts eg.
- `npm run dev`
- `npm run build`
- `npm run lint`
- etc.
3. Analyze used dependencies
```sh
$ deps analyze
```
- Save data to file:
```sh
deps analyze -o output.json
```
- Read later with:
```sh
deps -f output.json
```
4. When you're done, stop recording
```sh
$ . deps-stop
```
## 💁‍♂️ FAQ
#### How does it work?
`deps` detects which modules are loaded by using [V8's code coverage](https://nodejs.org/api/cli.html#cli_node_v8_coverage_dir) feature, so it's very accurate. However, it doesn't detect file-system reads, as they are simply read as text rather than actually being parsed and executed. That means it can't detect what files are statically analyzed by bundlers (eg. Webpack, Rollup, etc.). I am considering supporting FS reads in the future.
#### How does it compare to `depcheck`?
[`depcheck`](https://github.com/depcheck/depcheck) statically analyzes your project to see which dependencies are imported, avoiding the need to execute code. In contrast, `deps` executes code to analyze which dependencies were loaded during run-time. They work in completely different ways, but a major drawback for me is that `depcheck` requires a ["special"](https://github.com/depcheck/depcheck#special) for supporting whether a module was loaded via dev-tools.
## 💼 License
MIT
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