New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

clean-publish

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-publish

Clean your package before publish

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.9K
decreased by-19.63%
Maintainers
1
Weekly downloads
 
Created
Source

Clean Publish

Clean publish is a tool for removing configuration files and fields in package.json before publishing to npm.

How it works

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

Usage

First, install clean-publish:

$ npm install --save-dev clean-publish

# or

$ yarn add clean-publish --dev

Add clean-publish script to package.json:

{
  "scripts": "clean-publish"
}

Usage with arguments:

$ npm run clean-publish --files file1.js file2.js --fields scripts name

Exclude files and package.json fields

Files:

  • .eslintrc,
  • .eslintignore,
  • .babelrc,
  • .editorconfig,
  • .jsdocrc,
  • .lintstagedrc,
  • .size-limit,
  • .yaspellerrc,
  • jest.config.js,
  • .travis.yml,
  • yarn.lock,
  • package-lock.json,
  • yarn-error.log,
  • appveyor.ym

Fields:

  • eslintConfig,
  • jest,
  • yaspeller,
  • size-limit,
  • devDependencies,
  • babel

Example

  • Before clean-publish

Files and directories

node_modules
.eslintrc
.prettierrc
jest.config.js
CHANGELOG.md  
package.json
README.md
yarn.lock

package.json

{
  "name": "your-package",
  "version": "1.0.0",
  "description": "description",
  "author": "author",
  "license": "MIT",
  "scripts": {
    "test": "test"
  },
  "dependencies": {
    "chalk": "^2.4.1",
    "fs-extra": "^6.0.1",
    "lodash.omit": "^4.5.0"
  },
  "devDependencies": {
    "eslint": "^5.1.0",
    "eslint-config-logux": "^23.0.2",
    "eslint-config-standard": "^11.0.0",
    "eslint-plugin-import": "^2.13.0",
    "eslint-plugin-jest": "^21.17.0",
    "eslint-plugin-node": "^6.0.1",
    "eslint-plugin-promise": "^3.8.0",
    "eslint-plugin-security": "^1.4.0",
    "eslint-plugin-standard": "^3.1.0"
  }
}
  • After clean-publish

Files and directories

node_modules
CHANGELOG.md  
package.json
README.md
- .eslintrc
- .prettierrc
- jest.config.js
- yarn.lock

package.json

{
  "name": "your-package",
  "version": "1.0.0",
  "description": "description",
  "author": "author",
  "license": "MIT",
  "scripts": {
    "test": "test"
  },
  "dependencies": {
    "chalk": "^2.4.1",
    "fs-extra": "^6.0.1",
    "lodash.omit": "^4.5.0"
  },
-  "devDependencies": {
-    "eslint": "^5.1.0",
-    "eslint-config-logux": "^23.0.2",
-    "eslint-config-standard": "^11.0.0",
-    "eslint-plugin-import": "^2.13.0",
-    "eslint-plugin-jest": "^21.17.0",
-    "eslint-plugin-node": "^6.0.1",
-    "eslint-plugin-promise": "^3.8.0",
-    "eslint-plugin-security": "^1.4.0",
-    "eslint-plugin-standard": "^3.1.0"
-  }
}

Keywords

FAQs

Package last updated on 11 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc