Socket
Socket
Sign inDemoInstall

vodoun

Package Overview
Dependencies
11
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vodoun

A dependency injection framework for server-side node apps.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
1.06 MB
Created
Weekly downloads
 

Readme

Source

= Vodoun

image:https://travis-ci.org/aetheric/vodoun.svg?branch=master["Build Status", link="https://travis-ci.org/aetheric/vodoun"] image:https://coveralls.io/repos/github/aetheric/vodoun/badge.svg?branch=master["Coverage Status", link="https://coveralls.io/github/aetheric/vodoun"] image:https://badge.fury.io/js/vodoun.svg["npm version", link="https://badge.fury.io/js/vodoun"]

A dependency injection framework for server-side node apps.

== Installation

npm install vodoun --save

== Usage

.src/main/service/service-a.js [source,javascript]

import vodoun from 'vodoun';

vodoun.register('service_a', [], (service) => {

let stateChanged = false;

service.blergh = () => {
	console.log('BLERGH!!!');
	stateChanged = true;
});

});

.src/main/service/service-b.js [source,javascript]

import vodoun from 'vodoun'; import dbLib from 'db-lib';

vodoun.register('service_b', [ 'service_a' ], (service) => {

const serviceA = this.service_a;

return dbLib.connect('prot://localhost:8260/dbname').then((conn) => {

	service.query = (query, params) => conn.query(query, params);

	service.close = () => conn.close().then(serviceA.blergh);

});

});

.src/main/service/service-c.js [source,javascript]

import vodoun from 'vodoun';

vodoun.register('service_c', { bloopyWibble: 'service_a', wibbledyBloob: 'service_b'

}, (service) => {

const serviceA = this.bloopyWibble;
const serviceB = this.wibbledyBloop;

service.argh = (query, params) => {
	serviceA.blergh();
	return serviceB.query(query, params).then((result) => serviceB.close());
});

});

.src/main/index.js [source,javascript]

import vodoun from 'vodoun';

vodoun.scan('src/main', '**/*.js').then((files) => { console.log(Vodoun scan complete. ${files.length} files loaded.); return vodoun.resolve('service_c');

}).then((serviceC) => { return serviceC.argh('get stuff from somewhere when something = :param', { param: 'value' });

});

Keywords

FAQs

Last updated on 25 Jun 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc