Get a list of import paths and paths from a TypeScript, JSX, TSX, or JavaScript file.
Symbol
Transpiler.scan
@param code
The code to scan
const {imports, exports} = transpiler.scan(`
import {foo} from "baz";
export const hello = "hi!";
`);
console.log(imports); // ["baz"]
console.log(exports); // ["hello"]
Referenced types
type StringOrBuffer = string | NodeJS.TypedArray | ArrayBufferLike