0.1.1 • Published 3 years ago
accio-js v0.1.1
Accio
A dependency injection lib that use Typescript.
Install
npm i node-accio
# or
yarn add node-accio
Quick Start
your index.ts file:
import { Injectable, MainApplication, boost } from "accio-js";
@Injectable()
export class TheElderWand {
wave() {
console.log("boomb!!");
}
}
@MainApplication()
export class Wizard {
constructor(private wand: TheElderWand) {}
@boost()
use() {
this.wand.wave();
}
}
your tsconfig.json file:
{
"compilerOptions": {
"target": "ES2015",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}
run ts-node index.ts
then you will get boomb!!
in your terminal!
Document
work in progress :p