Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dgrijuela/modular-lodash-codemod
https://github.com/dgrijuela/modular-lodash-codemod
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dgrijuela/modular-lodash-codemod
- Owner: dgrijuela
- License: mit
- Created: 2017-09-11T16:43:43.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-16T12:16:05.000Z (about 1 year ago)
- Last Synced: 2024-08-02T07:23:20.621Z (3 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-codemods - modular-lodash-codemod - Makes all your lodash imports modular. (Libraries / Lodash)
README
This script makes all your lodash imports modular.
For example:
```
import { sortBy } from 'lodash'
import { throttle, debounce } from 'lodash'
```Would be:
```
import sortBy from 'lodash/sortBy'
import throttle from 'lodash/throttle'
import debounce from 'lodash/debounce'
```Setup & Run
```
npm install -g jscodeshift
git clone https://github.com/dgrijuela/modular-lodash-codemod.git
jscodeshift -t modular-lodash-codemod/modular-lodash.js
```Check both JS and JSX files using the `--extensions` flag:
```
jscodeshift --extensions=js,jsx -t modular-lodash-codemod/modular-lodash.js
```