New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

depsort

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depsort

CLI tool to identify dependencies that can be safely moved to devDependencies

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

depsort

A CLI tool that helps TypeScript library and app developers identify if packages in their dependencies can be safely moved to devDependencies. This helps end users save on their project bundle size by not importing unneeded dependencies.

Installation

npm install -g depsort

Or use with npx:

npx depsort

Usage

depsort [options]

Options:
  --fix              Automatically move packages to devDependencies
  --json             Output results as JSON
  --exclude <paths>  Exclude paths from analysis (glob patterns)
  --include <paths>  Only analyze specific paths (glob patterns)
  --help             Show help

How it works

depsort analyzes your TypeScript/JavaScript project to:

  • Parse your package.json dependencies
  • Scan all source files for imports
  • Classify imports as:
    • Type-only imports (can be devDependency)
    • Runtime imports in test/dev files (can be devDependency)
    • Runtime imports in production code (must stay in dependencies)
  • Report which packages can be safely moved to devDependencies

Example Output

Analyzing dependencies...

Found 3 packages that can be moved to devDependencies:

  @types/node          → devDependencies (type-only imports)
  jest                 → devDependencies (only in test files)
  typescript           → devDependencies (build tool, not in source)

Run with --fix to automatically update package.json

License

MIT

Keywords

dependencies

FAQs

Package last updated on 17 Jan 2026

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