1.0.0 • Published 5 years ago
@mkmod-ts/ts-get-exported-variable v1.0.0
@mkmod-ts/ts-get-exported-variable
Uses typescript to get const exported 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
5 years ago