clean-yarn

Deletes all node_modules folders and yarn.lock files in a Yarn project, including workspaces

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
clean-yarn
101.1.02 years ago2 years agoMinified + gzip package size for clean-yarn in KB

Readme

Clean Yarn

<img src="docs/assets/images/nuke-yarn.gif" alt="nuke-yarn example GIF">

It's the only way to be sure.


!npm packagenpm-imgnpm-url !Build Statusbuild-imgbuild-url !Downloadsdownloads-imgdownloads-url !Issuesissues-imgissues-url !Code Coveragecodecov-imgcodecov-url !Commitizen Friendlycommitizen-imgcommitizen-url !Semantic Releasesemantic-release-imgsemantic-release-url
Deletes all nodemodules 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 cding 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.