https://github.com/jcoreio/jscodeshift-replace-lodash-method-packages
jscodeshift script to convert import 'lodash.get' to import 'lodash/get' etc.
https://github.com/jcoreio/jscodeshift-replace-lodash-method-packages
Last synced: 10 months ago
JSON representation
jscodeshift script to convert import 'lodash.get' to import 'lodash/get' etc.
- Host: GitHub
- URL: https://github.com/jcoreio/jscodeshift-replace-lodash-method-packages
- Owner: jcoreio
- License: mit
- Created: 2018-06-20T03:11:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T11:12:41.000Z (over 3 years ago)
- Last Synced: 2024-04-14T22:48:01.034Z (about 2 years ago)
- Language: JavaScript
- Size: 510 KB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# jscodeshift-replace-lodash-method-packages
[](https://travis-ci.org/jcoreio/jscodeshift-replace-lodash-method-packages)
[](https://codecov.io/gh/jcoreio/jscodeshift-replace-lodash-method-packages)
[](https://github.com/semantic-release/semantic-release)
[](http://commitizen.github.io/cz-cli/)
This is a codemod script for use with
[JSCodeshift](https://github.com/facebook/jscodeshift) that helps convert lodash
method package imports/requires (e.g. `lodash.mapvalues`) to imports from lodash
submodules (e.g. `lodash/mapValues`)
## Setup & Run
1. `yarn global add jscodeshift`
1. `git clone https://github.com/jcoreio/jscodeshift-replace-lodash-method-packages.git`
1. Run `yarn install` in the cloned directory
1. `jscodeshift -t /jscodeshift-replace-lodash-method-packages/index.js `
* `path` - files or directory to transform;
* use the `-d` option for a dry-run and use `-p` to print the output for comparison;
* use the `--extensions` option if your files have different extensions than `.js` (for example, `--extensions js,jsx`);
* if you use flowtype, you might also need to use `--parser=flow` or `--parser=babylon`;
* see all available [jscodeshift options](https://github.com/facebook/jscodeshift#usage-cli).