Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joyeecheung/node-dep-codemod
A collection of JSCodeshift codemod scripts for migrating code that uses deprecated Node.js APIs
https://github.com/joyeecheung/node-dep-codemod
Last synced: 4 months ago
JSON representation
A collection of JSCodeshift codemod scripts for migrating code that uses deprecated Node.js APIs
- Host: GitHub
- URL: https://github.com/joyeecheung/node-dep-codemod
- Owner: joyeecheung
- Created: 2018-02-18T17:20:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-18T17:20:30.000Z (almost 7 years ago)
- Last Synced: 2024-08-02T07:17:04.001Z (7 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-codemods - node-dep-codemod - A collection of JSCodeshift codemod scripts for migrating code that uses deprecated Node.js APIs. (JavaScript)
README
# Codemods for deprecated Node.js APIs
This repository contains a collection of
[JSCodeshift](https://github.com/facebook/jscodeshift)
codemod scripts for migrating code that uses
[deprecated Node.js APIs](https://nodejs.org/api/deprecations.html).## Setup & Run
```
npm install -g jscodeshift
git clone https://github.com/joyeecheung/node-dep-codemod.git
jscodeshift -t transforms/subsystem/codemod-name path/to/file/or/directory
```Use the `-d` option for a dry-run, `-p` to print the output for
comparison. For more options run `jscodeshift -h`.## Transforms
### Buffers
#### [DEP005](https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor)
```
jscodeshift -t transforms/buffer/buffer-constructor-to-buffer-alloc.js path/to/file/or/directory
jscodeshift -t transforms/buffer/buffer-constructor-to-buffer-from.js path/to/file/or/directory
```## TODO
A binary target that runs codemods by subsystems/DEPIDs