🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

ddi

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ddi

djanky dependency injection

1.1.0
latest
Source
npm
Version published
Weekly downloads
3
-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

ddi

Djanky dependency injection for javascript

browser support

Installation

npm install ddi

Usage

var create_scope = require('ddi');

var scope = create_scope();

scope.foo = 'bar';
scope(function(foo) {
  console.log(foo)
})();

yields bar.

You can also "nest" dependencies.

var scope = create_scope(); 
scope.foo = 'bar';
scope.baz = function(foo, bazzoo) {
  console.log(foo, bazzoo);
};
scope(function(baz) {
  baz('pizza');
})();

yields bar pizza. As well as use angular style dependency declaration.

var create_scope = require('ddi');

var scope = create_scope();

scope.foo = 'bar';
scope(['foo', function(lol) {
  console.log(lol)
})();

yields bar. Finally, all_argments_resolved will tell you whether or not more arguments need to be supplied to your function.

var create_scope = require('ddi');

var scope = create_scope();

scope.foo = 'bar';
var resolved = scope(function(foo) { });
console.log(resolved.all_argments_resolved);

yields true.

Keywords

dependency

FAQs

Package last updated on 23 Oct 2014

Did you know?

Socket

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