Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Lightweight wrap and extension of angular/di.js for TypeScript.
npm install di-ts
You need to use --emitDecoratorMetadata flag when compile you typescript files. This flag is not supported in the last released version of TypeScript, you need to download and use last commit of master branch.
import {Inject} from 'di-ts'
import {Engine} from './engine'
@Inject
export class Car {
constructor(public engine: Engine) {}
}
import {Injector} from 'di-ts'
export class Engine {
}
@Provide(Engine)
export class MockEngine {
}
/// <reference path="node_modules/di-ts/di-ts.d.ts"/>
import {Injector} from 'di-ts'
import {Car} from './car'
import {Engine, MockEngine} from './engine'
var injector = new Injector();
var car: Car = injector.get(Car); //instantiate car, car.engine is magically instance of Engine! :)
var injector2 = new Injector([MockEngine]);
var car2: Car = injector2.get(Car); //instantiate car, car.engine is instance of MockEngine! :)
FAQs
Lightweight wrap and extension of di.js v2 for TypeScript.
The npm package di-ts receives a total of 3 weekly downloads. As such, di-ts popularity was classified as not popular.
We found that di-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.