# Clean Publish

> A tool for removing configuration files, fields, and development scripts from package.json before publishing to npm.

- URL: https://evilmartians.com/opensource/clean-publish
- GitHub: https://github.com/shashkovdanil/clean-publish
- Authors: Danil Shashkov

---

Clean Publish is a tool for removing configuration files, fields, and development scripts from `package.json` before publishing to npm.

The `clean-publish` command copies project files (excluding configuration files) to a temporary folder, removes the extra and development-only scripts from `package.json`, and calls `npm publish` on the temporary folder.

**A simple example:**

- Before cleaning:

```
node_modules
src
.eslintrc
.prettierrc
package.json
```
```json
{
  "name": "author",
  "scripts": {
    "lint": "eslint"
  },
  "dependencies": {},
  "devDependencies": {}
}
```

- After cleaning:

`node_modules`, `.eslintrc`, `.prettierrc`, `lint` scripts and the `devDependecies` field were removed (empty objects will also be deleted).

```
src
package.json
```
```json
{
  "name": "author",
}
```
