detective icon indicating copy to clipboard operation
detective copied to clipboard

Support ES6 imports

Open lukehorvat opened this issue 8 years ago • 3 comments

Tried this:

import detective from 'detective';
import fs from 'fs';

let src = fs.readFileSync(__filename);
let requires = detective(src, { parse: { ecmaVersion: 6, sourceType: 'module' } });

console.log(requires);

Prints out [] instead of ['detective', 'fs']. Could we make detective support ES6 imports?

lukehorvat avatar Sep 09 '15 02:09 lukehorvat

+1 for this!

tnrich avatar Oct 18 '15 22:10 tnrich

That may be outside of the scope of this module. Try https://www.npmjs.com/package/detective-es6.

mrjoelkemp avatar Aug 03 '16 10:08 mrjoelkemp

just made something similar https://github.com/egoist/konan

egoist avatar Feb 05 '17 12:02 egoist