facebook / jscodeshift

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

export Runner from jscodeshift #380

Open sibelius opened 4 years ago

sibelius commented 4 years ago
import { Runner } from  'jscodeshift'

can we export Runner from jscodeshift to make it easy to reuse it in API way?

related to https://github.com/facebook/jscodeshift/issues/179

does it make sense to use jest-worker here instead of custom worker processing logic?

danieldelcore commented 3 years ago

Hey @sibelius,

Have you seen this issue? https://github.com/facebook/jscodeshift/issues/398 Seems like it's possible by importing runner like so: const Runner = require('jscodeshift/src/Runner');

Feels like a bit of a hack to me though, it would be great if an official solution was available

sys13 commented 1 year ago

Unfortunately, this does not work with esm module projects

Indomi commented 1 year ago

Unfortunately, this does not work with esm module projects. Nothing I can do only but destroy my esm project due to this. :(