@royriojas/get-exports-from-file
v1.4.1
Published
parses a javascript file and outputs a list of exports
Downloads
68
Maintainers
Readme
get-exports-from-file
just a function used by vscode-exports-autocomplete
api is straighforward:
import getExportsFromFile from './index'
// make sure to use absolute paths, not relative paths
getExportsFromFile.es6('/some-js-file.js').then((result) = {
result.exportsFromFile // array of objects, each object has a String `name` and Boolean `default` props
})
// second argument is a flag to signify you want to attempt to get CommonJS export
getExportsFromFile.cjs('/CJS.js', true).then((result) = {
result.exportsFromFile // array of objects, each object has a String `name` and Boolean `default` props
})