https://github.com/rajasegar/moment-dayjs-codemod
A Codemod to migrate from moment.js to day.js
https://github.com/rajasegar/moment-dayjs-codemod
codemod codemods dayjs moment moment-js momentjs
Last synced: 5 months ago
JSON representation
A Codemod to migrate from moment.js to day.js
- Host: GitHub
- URL: https://github.com/rajasegar/moment-dayjs-codemod
- Owner: rajasegar
- License: mit
- Created: 2021-05-28T11:23:01.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-05T11:28:22.000Z (over 4 years ago)
- Last Synced: 2025-02-23T21:05:03.268Z (7 months ago)
- Topics: codemod, codemods, dayjs, moment, moment-js, momentjs
- Language: JavaScript
- Homepage:
- Size: 196 KB
- Stars: 34
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE-OF-CONDUCT.md
Awesome Lists containing this project
README
# moment-dayjs-codemod

[](https://npmjs.org/package/moment-dayjs-codemod "View this project on npm")
[](https://coveralls.io/github/rajasegar/moment-dayjs-codemod?branch=main)A collection of codemods for migrating from [moment.js](https://momentjs.com/) to [day.js](https://day.js.org/)
## Usage
To run the codemod , you would run the following:
```
npx moment-dayjs-codemod path/of/files/ or/some**/*glob.js# or
yarn global add moment-dayjs-codemod
moment-dayjs-codemod path/of/files/ or/some**/*glob.js
```## Local Usage
```
node ./bin/cli.js path/of/files/ or/some**/*glob.js
```## Transforms
* [default](transforms/default/README.md)
## Contributing
### Installation
* clone the repo
* change into the repo directory
* `yarn`### Running tests
* `yarn test`
### Update Documentation
* `yarn update-docs`
### References
- [AST Explorer](https://astexplorer.net/#/gist/7598ca87108e752f21bee9bffbd58ec2/149bbcbeebac06f6dd2290d75e775ec44578694c)
- https://ottonova.tech/why-we-switched-from-moment-js-to-day-js/
- https://medium.datadriveninvestor.com/https-medium-com-sabesan96-why-you-should-choose-day-js-instead-of-moment-js-9cf7bb274bbd