1.0.0 • Published 3 years ago
@mkmod-ts/ts-get-exported-variable v1.0.0
@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.
1.0.0
3 years ago