https://github.com/cfware/babel-replace-variable-init
Generate a babel plugin which replaces variable initializations
https://github.com/cfware/babel-replace-variable-init
Last synced: about 1 year ago
JSON representation
Generate a babel plugin which replaces variable initializations
- Host: GitHub
- URL: https://github.com/cfware/babel-replace-variable-init
- Owner: cfware
- License: mit
- Created: 2020-10-01T11:42:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-02T12:06:39.000Z (over 5 years ago)
- Last Synced: 2024-04-25T05:02:21.965Z (almost 2 years ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-replace-variable-init [![NPM Version][npm-image]][npm-url]
Generate a babel plugin which replaces variable initializations
## Usage
```js
import babelReplaceVariableInit from 'babel-replace-variable-init';
export default babelReplaceVariable({
variableName: ({types: t}) => t.stringLiteral('')
});
```
This will create a babel plugin which will replace the initialization of any
`variableName` variable with an empty string.
[npm-image]: https://img.shields.io/npm/v/babel-replace-variable-init.svg
[npm-url]: https://npmjs.org/package/babel-replace-variable-init