Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bonniernews/depsane
https://github.com/bonniernews/depsane
Last synced: about 7 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/bonniernews/depsane
- Owner: BonnierNews
- License: mit
- Created: 2021-10-03T20:15:58.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-08-23T07:20:13.000Z (3 months ago)
- Last Synced: 2024-11-08T13:21:45.367Z (10 days ago)
- Language: JavaScript
- Size: 277 KB
- Stars: 2
- Watchers: 9
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# depsane
[![Test application](https://github.com/BonnierNews/depsane/actions/workflows/run-tests.yml/badge.svg?branch=master)](https://github.com/BonnierNews/depsane/actions/workflows/run-tests.yml)
Checks for missing `dependencies` based on code reachable from the `main`
entrypoint specified in `package.json` (defaults: `index.js`). Furthermore:
if a `bin`-object is specified in `package.json` all code reachable from those
files will also be included.`depsane` is focused on determining which dependencies that should be
present specifically in `dependencies` and `devDependencies`. It classifies a
dependency found in `devDependencies` used in the main code path as missing,
and a dependency only used as a devDependency but that is specified in
`dependencies` is considered missing.This solves the problem where an application works fine locally and during
testing but fails once deployed as the deployed version will only be installed
with its' `dependencies` but during testing and development both
`devDependencies` and `dependencies` are installed.There is also some experimental heuristics implemented to determine if `mocha`
or `eslint` and their associated plugins are used as devDependencies or not.## Installation
```bash
npm install --save-dev depsane
```## Usage
```bash
npx depsane [directory] [arguments]
```Prints missing dependencies and unused dependencies.
Exits with code `0` if no missing or unused dependencies are found and `1` otherwise.
The directory defaults to the current directory.
All of the arguments are optional:
`--ignore-dirs`: comma-separated list of dirs to ignore.
`--ignores`: comma-separated list of dependencies to ignore, supports wildcards (i.e. "eslint*" will ignore all dependencies that starts with eslint).
## Changelog
Can be found [here](CHANGELOG.md).
## License
Released under the [MIT license](https://tldrlegal.com/license/mit-license).