ts-nameof.macro
TypeScript icon, indicating that this package has built-in type declarations

4.2.2 • Public • Published

ts-nameof.macro

npm version Build Status Babel Macro stable

nameof in TypeScript.

This is a babel macro of ts-nameof.

Setup

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

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

import nameof from "ts-nameof.macro";
 
nameof(window.alert);

Transforms to:

"alert";

Transforms

Read here

Other

Package Sidebar

Install

npm i ts-nameof.macro

Weekly Downloads

1,019

Version

4.2.2

License

MIT

Unpacked Size

11.9 kB

Total Files

5

Last publish

Collaborators

  • dsherret