ts-nameof
Version:
nameof in TypeScript
47 lines (31 loc) • 1.83 kB
Markdown
ts-nameof
==========
[](https://badge.fury.io/js/ts-nameof)
[](https://travis-ci.org/dsherret/ts-nameof)
[](http://github.com/badges/stability-badges)
[`nameof`](https://msdn.microsoft.com/en-us/library/dn986596.aspx) in TypeScript.
```
npm install ts-nameof @types/ts-nameof --save-dev
```
## Setup
### 1. Build Setup
Follow any of these instructions:
* [Webpack](https://github.com/dsherret/ts-nameof/blob/master/packages/ts-nameof/setup/webpack.md)
* [Gulp](https://github.com/dsherret/ts-nameof/blob/master/packages/ts-nameof/setup/gulp.md)
* [FuseBox](https://github.com/dsherret/ts-nameof/blob/master/packages/ts-nameof/setup/fusebox.md)
* [tsc](https://github.com/dsherret/ts-nameof/blob/master/packages/ts-nameof/setup/tsc.md)
* [Jest](https://github.com/dsherret/ts-nameof/blob/master/packages/ts-nameof/setup/jest.md)
* [Custom](https://github.com/dsherret/ts-nameof/blob/master/packages/ts-nameof/setup/custom.md)
* Others - Open an [issue](https://github.com/dsherret/ts-nameof/issues).
These instructions need updating to use the transformation API, but will still work in the meantime:
* Nuxt - Use [https://github.com/Kukks/nuxt-ts-nameof](https://github.com/Kukks/nuxt-ts-nameof#readme)
### 2. Declaring global `nameof` function
Install `@types/ts-nameof`:
```
npm install @types/ts-nameof --save-dev
```
## Transforms
[Read here](https://github.com/dsherret/ts-nameof/blob/master/README.md)
## Other
* [Contributing](https://github.com/dsherret/ts-nameof/blob/master/CONTRIBUTING.md)
* [Development](https://github.com/dsherret/ts-nameof/blob/master/DEVELOPMENT.md)