Clean Yarn
Deletes all node_modules folders and yarn.lock files in a Yarn project, including workspaces
Install
It's recommended to use a global installation, so you can use this in any project:
npm install -g clean-yarn
Usage
CLI
Simply run nuke-yarn
in the root of your project:
$ nuke-yarn
You can also pass a working directory instead of cd
ing to the root of your project:
$ nuke-yarn --cwd /path/to/project
Pass --help
to see all options:
$ nuke-yarn --help
Delete all node_modules and yarn.lock files in the current project
USAGE
$ nuke-yarn [-c <value>]
FLAGS
-c, --cwd=<value> [default: .] Working directory for the project
DESCRIPTION
Delete all node_modules and yarn.lock files in the current project
JS/TS API
import { clean } from "clean-yarn";
clean(); // Defaults to current working directory
clean("/path/to/project"); // Pass a working directory
Development Status
This project uses semantic-release for versioning.
Any time the major version changes, there may be breaking changes. If it is working well for you, consider
pegging to the current major version, e.g. clean-yarn@v1
, to avoid breaking changes. Alternatively,
you can always point to the most recent stable release with the clean-yarn@latest
.
Developing
Clone the repo and then run npm install
to set up the pre-commit hooks.
Run npm run dev
to start the development server, and npm run build
to create a production build
of the library.
The library files are stored in src
, while the files for the development page are in dev-src
.
Author
The original clean.js
script was created by Miguel Bermudez. It was then converted to TypeScript and adapted into
a CLI library with tests by Nick DeRobertis. MIT License.