New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
8
increased by700%
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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc