@mkmod-ts/ts-get-exported-variable
v1.0.0
Published
Uses `typescript` to get `const export`ed variable from a `.ts` file:
Downloads
2
Readme
@mkmod-ts/ts-get-exported-variable
Uses typescript
to get const export
ed variable from a .ts
file:
const getExportedVariable = require("@mkmod-ts/ts-get-exported-variable")
const code = `
export const name = "Test"
`
console.log(
getExportedVariable(code, "name")
)
Returns null
if variable was not found.