facebook / jscodeshift

A JavaScript codemod toolkit.
https://jscodeshift.com
MIT License
9.26k stars 477 forks source link

Expose runner to as interface #457

Open christian-bromann opened 2 years ago

christian-bromann commented 2 years ago

Hey 👋

it would be nice if jscodeshift can be used programmatically. Something like:

import { Runner } from 'jscodeshift';

allowing to pass in the arguments from the CLI as object.

danieldelcore commented 2 years ago

I would really appreciate this as well.

FWIW this is possible via the following:

import jscodeshift from "jscodeshift/src/Runner";

sys13 commented 1 year ago

The import statement (import jscodeshift from 'jscodeshift/src/Runner';) does not work. The error is Cannot find module 'jscodeshift/src/Runner' or its corresponding type declarations.ts(2307)