ts-nameof.macro
v4.2.2
Published
Babel macro for nameof in TypeScript.
Downloads
4,242
Maintainers
Readme
ts-nameof.macro
nameof
in TypeScript.
This is a babel macro of ts-nameof.
Setup
- Install dependencies:
npm install --save-dev babel-plugin-macros ts-nameof.macro
Ensure
babel-plugin-macros
is properly setup (Instructions).Import and use the default export. For example:
import nameof from "ts-nameof.macro";
nameof(window.alert);
Transforms to:
"alert";