Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
A lightweight Dependency Injection library. Using es6 and other features, remove unnecessary concepts, easy and convenient to use.
A lightweight Dependency Injection library. Using es6 and other features, remove unnecessary concepts, easy and convenient to use.
npm i power-di --save
import { IocContext } from 'power-di';
class AService { }
// default instance, you can also new IocContext to get a instance.
const context = IocContext.DefaultInstance;
context.register(AService);
const aService = context.get(AService); // a instance of AService
class AService { }
const context = IocContext.DefaultInstance;
context.register(AService, 'XService'); // key need a string or class, e.g super class or whatever class.
context.get('XService');
const context = new IocContext();
@injectable()
class NRService { }
@injectable()
class LITestService {
@inject()
public testService: NRService;
}
const test = context.get(LITestService);
class A { }
@classInfo()
class B extends A { }
@classInfo()
class C extends A { }
@injectable()
class LITestService {
@imports({ type: A })
public testService: A[];
}
const test = context.get(LITestService); // test.testService as A[];
const context = new IocContext;
class NRService { }
context.register(NRService);
class TestComponent extends Component<{}, {}> {
@inject()
service: NRService;
componentDidMount() {
t.true(this.service instanceof NRService);
}
render(): any {
return null;
}
}
create(
<IocProvider context={context}>
<TestComponent />
</IocProvider>
);
Power DI introduced the concept of class loader. We can customize the find rule of ioc.
2.4.14 / 2021-09-17
FAQs
A lightweight Dependency Injection library. Using es6 and other features, remove unnecessary concepts, easy and convenient to use.
The npm package power-di receives a total of 283 weekly downloads. As such, power-di popularity was classified as not popular.
We found that power-di demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.