1.0.1 • Published 4 months ago

ts5-nameof.macro v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

ts5-nameof.macro

npm version Build Status Babel Macro stable

nameof in TypeScript.

This is a babel macro of ts5-nameof.

Setup

  1. Install dependencies:
npm install --save-dev babel-plugin-macros ts5-nameof.macro
  1. Ensure babel-plugin-macros is properly setup (Instructions).

  2. Import and use the default export. For example:

import nameof from "ts5-nameof.macro";

nameof(window.alert);

Transforms to:

"alert";

Transforms

Read here

Other