node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »

remove-react-proptypes

remove-react-proptypes

Remove React PropTypes. Removes all occurrences of <component>.propTypes = <types>.

Installation

npm install --save-dev remove-react-proptypes

Or install the CLI globally:

npm install --global remove-react-proptypes

Usage

CLI:

remove-react-proptypes input.js > output.js
# or pipe to stdin:
cat input.js | remove-react-proptypes | uglifyjs -o output.js

Node:

const removeReactPropTypes = require('remove-react-proptypes')
const outputString = removeReactPropTypes(inputString)

Node.js streams:

const removeReactPropTypes = require('remove-react-proptypes/stream')
fs.createReadStream('input.js')
  .pipe(removeReactPropTypes())
  .pipe(fs.writeReadStream('output.js'))

Browserify:

browserify -g remove-react-proptypes/stream -input.js > output.js

License

MIT