ng-di-transpiler v0.1.10 is a dependency injection transpiler for Angular that generates platform-specific provider files at build time. It allows developers to define interfaces for tokens and create typed provider configurations, which are then transpiled into compiled provider files. The tool is designed for Angular 2+ applications and aims to reduce boilerplate and improve type safety in DI setup. It is still in early stages (v0.1.x) with experimental features like interface-based tokens. Alternatives include Angular's built-in provider factories or custom AOT compilation setups, but this package provides a dedicated transpilation step. Release cadence is sporadic with occasional bug fixes. Ships TypeScript types and uses a CLI command (ngdt) for integration.
npm install ng-di-transpilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to define tokens, create a provider file, and run the CLI to transpile.
Stick to using OpaqueToken/InjectionToken for token types until feature is stable.
Ensure exported const in provider files is explicitly typed with the interface extending TokenProviders.
Use explicit --files argument or configure ngdtOptions in tsconfig.json.
Add import: import { TokenProviders } from 'ng-di-transpiler';Instantiate the provider class: new SomeTokenProvider(ActualClass) instead of new SomeTokenProvider(ActualClass).
Install locally: npm install ng-di-transpiler --save-dev, then use npx ngdt or add script in package.json.
Ensure your platform tokens interface extends TokenProviders and the exported const is typed with that interface.
No dependency data recorded yet.