Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nickderobertis/clean-yarn
Deletes all node_modules folders and yarn.lock files in a Yarn project, including workspaces
https://github.com/nickderobertis/clean-yarn
Last synced: about 1 month ago
JSON representation
Deletes all node_modules folders and yarn.lock files in a Yarn project, including workspaces
- Host: GitHub
- URL: https://github.com/nickderobertis/clean-yarn
- Owner: nickderobertis
- License: mit
- Created: 2022-06-28T22:22:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-30T21:55:43.000Z (over 2 years ago)
- Last Synced: 2024-12-03T21:08:00.522Z (about 2 months ago)
- Language: TypeScript
- Size: 485 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Clean Yarn
It's the only way to be sure.
[![npm package][npm-img]][npm-url]
[![Build Status][build-img]][build-url]
[![Downloads][downloads-img]][downloads-url]
[![Issues][issues-img]][issues-url]
[![Code Coverage][codecov-img]][codecov-url]
[![Commitizen Friendly][commitizen-img]][commitizen-url]
[![Semantic Release][semantic-release-img]][semantic-release-url]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:
```bash
npm install -g clean-yarn
```## Usage
### CLI
Simply run `clean-yarn` in the root of your project:
```bash
$ clean-yarn
```You can also pass a working directory instead of `cd`ing to the root of your project:
```bash
$ clean-yarn --cwd /path/to/project
```Pass `--help` to see all options:
```bash
$ clean-yarn --help
Delete all node_modules and yarn.lock files in the current projectUSAGE
$ clean-yarn [-c ]FLAGS
-c, --cwd= [default: .] Working directory for the projectDESCRIPTION
Delete all node_modules and yarn.lock files in the current project
```### JS/TS API
```ts
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](https://github.com/semantic-release/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](https://github.com/miguelbermudez). It was then converted to TypeScript and adapted into
a CLI library with tests by Nick DeRobertis. MIT License.[build-img]: https://github.com/nickderobertis/clean-yarn/actions/workflows/release.yml/badge.svg
[build-url]: https://github.com/nickderobertis/clean-yarn/actions/workflows/release.yml
[downloads-img]: https://img.shields.io/npm/dt/clean-yarn
[downloads-url]: https://www.npmtrends.com/clean-yarn
[npm-img]: https://img.shields.io/npm/v/clean-yarn
[npm-url]: https://www.npmjs.com/package/clean-yarn
[issues-img]: https://img.shields.io/github/issues/nickderobertis/clean-yarn
[issues-url]: https://github.com/nickderobertis/clean-yarn/issues
[codecov-img]: https://codecov.io/gh/nickderobertis/clean-yarn/branch/main/graph/badge.svg
[codecov-url]: https://codecov.io/gh/nickderobertis/clean-yarn
[semantic-release-img]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-release-url]: https://github.com/semantic-release/semantic-release
[commitizen-img]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
[commitizen-url]: http://commitizen.github.io/cz-cli/