npm

Need private packages and team management tools?Check out npm Orgs. »

This package has been deprecated

Author message:

I have no more ideas

module-registry

0.0.6 • Public • Published

Module Registry

npm package npm downloads Build Status

Getting Started

npm i module-registry

Usage

import { Module } from 'module-registry'
 
@Module({
    name: 'SomeModule',
})
export default class SomeModule {
    public hello() {
        return 'hello';
    }
}
 
@Module({
    dependencies: [ SomeModule ],
    name: 'TestController',
    marker: 'Http',
    method: 'get',
    path: '/hello'
})
export default class TestControllerModule {
    constructor(
        public readonly somes: SomeModule) {
    }
    public work() {
        return somes.hello();
    }
}
import ModuleRegistry from 'module-registry'
 
const registry = new ModuleRegistry('./modules', path => path.match(/\.Module.(ts|js)/));
registry.initialize();
 
const someModule = registry.lookup<TestControllerModule>('TestController');
console.log(someModule.hello())

License

MIT

Keywords

install

npm i module-registry

Downloadsweekly downloads

7

version

0.0.6

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability