Installation
You can get the latest release and the type definitions using npm:
npm install [email protected] reflect-metadata --save
The InversifyJS type definitions are included in the inversify npm package. InversifyJS requires the experimentalDecorators
, emitDecoratorMetadata
and lib
compilation options in your tsconfig.json
file.
{
"compilerOptions": {
"target": "es5",
"lib": ["es6"],
"types": ["reflect-metadata"],
"module": "commonjs",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}
InversifyJS requires a modern JavaScript engine with support for:
- Reflect metadata
- Promise (Only required if using provider injection)
- Proxy (Only required if using activation handlers)
If your environment doesn't support one of these you will need to import a shim or polyfill.
Check out the Environment support and polyfills page in the wiki to learn more.