Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dependency-injection

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependency-injection - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

2

lib/DIConfigurator.js

@@ -15,2 +15,3 @@ // Generated by CoffeeScript 1.6.3

"arguments": [],
instantiate: true,
setup: {}

@@ -41,2 +42,3 @@ };

s = di.addService(name, service.service, service["arguments"]);
s.instantiate = service.instantiate;
_ref = service.setup;

@@ -43,0 +45,0 @@ for (method in _ref) {

8

lib/Service.js

@@ -12,2 +12,4 @@ // Generated by CoffeeScript 1.6.3

Service.prototype.instantiate = true;
Service.prototype.setup = null;

@@ -44,4 +46,6 @@

};
Service = require(this.service);
service = new (wrapper(Service, this.di.autowireArguments(Service, this["arguments"])));
service = require(this.service);
if (this.instantiate === true) {
service = new (wrapper(service, this.di.autowireArguments(service, this["arguments"])));
}
called = [];

@@ -48,0 +52,0 @@ _ref = this.setup;

{
"name": "dependency-injection",
"description": "Dependency injection with configuration and autowire for node js and browser",
"version": "1.0.1",
"version": "1.1.0",
"author": {

@@ -6,0 +6,0 @@ "name": "David Kudera",

@@ -83,2 +83,18 @@ # Dependency injection

## Not instantiate services
When you want for example use jQuery as service, you will not want to automatically call something like `new jquery`.
So you can tell DI, that this service will not be instantiate.
```
{
"services": {
"jquery": {
"service": "jquery"
"instantiate": false
}
}
}
```
## Autowiring

@@ -123,4 +139,4 @@

Maybe it will be better for someone to use this DI without configuration, so here is example of application and translator
definition.
Maybe it will be better for someone to use this DI without configuration, so here is example of application, translator
and jquery definition.

@@ -137,2 +153,5 @@ ```

.addSetup('setLanguage', ['en']);
var service = di.addService('jquery', 'jquery');
service.instantiate = false;
```

@@ -146,2 +165,5 @@

* 1.0.1
+ Added informations about autowiring factories
+ Added informations about autowiring factories
* 1.1.0
+ Support for not-instantiate services

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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