0.2.1 • Published 2 years ago

xpose v0.2.1

Weekly downloads
48
License
ISC
Repository
-
Last release
2 years ago

xpose

A tiny, flexible dependency injection library for NodeJS.

Installation

$ npm install -S xpose

Example usage

/index.js

const xpose = require('xpose');

const {App} = xpose({
    path: 'src/app/**/*.js',
    eager: true,
    include: [
        xpose({
            path: 'src/lib/**/*.js',
        }),
    ],
});

/src/app/App.js

module.exports = ({Service}) => {

    console.log(Service); // 123
}

/src/app/Service.js

module.exports = ({Helper}) => {

    console.log('Access to helper library:', Helper);

    return 123;
}

/src/lib/Helper.js

module.exports = () => {
    return {
        // Lazy-loaded resource
    };
}
0.2.1

2 years ago

0.2.0

4 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.1

7 years ago