tnm
ts-nameof.macro
npm i ts-nameof.macro
tnm

ts-nameof.macro

nameof in TypeScript

by David Sherret

4.2.2 (see all)License:MITTypeScript:Built-In
npm i ts-nameof.macro
Readme

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

No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate