npx ember-no-rsvp-codemod native-promise path/of/files/ or/some**/*glob.js
# or
yarn global add ember-no-rsvp-codemod
ember-no-rsvp-codemod native-promise path/of/files/ or/some**/*glob.js
node ./bin/cli.js native-promise path/of/files/ or/some**/*glob.js
Input (basic.input.js):
import { Promise, reject, resolve } from 'rsvp';
import Foo from 'foo'; // untouched
async function awaitPromises() {
await Promise.resolve();
await reject(new Error('Error'));
await resolve(123);
}
Output (basic.output.js):
import Foo from 'foo'; // untouched
async function awaitPromises() {
await Promise.resolve();
await Promise.reject(new Error('Error'));
await Promise.resolve(123);
}