
Research
/Security News
Popular Go Decimal Library Targeted by Long-Running Typosquat with DNS Backdoor
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.
JavaScript dependency injection with the Decorators syntax.
npm i -S wrasse
First, you can instantiate Wrasse and it needs export. Because it is necessary to solve Wrasse instantiation before any import, it is cut out as a single source.
For example, as wrasse-singleton.js.
import Wrasse from 'wrasse';
const wr = new Wrasse();
export default wr;
Second, you can set a module. You must register the key to get the module.
register-dependencies.js
import wr from './wrasse-singleton';
import _ComponentA from './component-a';
import _ComponentB from './component-b';
import _ComponentC from './component-c';
import {
ComponentA,
ComponentB,
ComponentC
} from './module-keys';
wr.set(ComponentA, _ComponentA);
wr.set(ComponentB, _ComponentB);
wr.set(ComponentC, _ComponentC);
export default wr;
module-keys.js
export const ComponentA = Symbol('ComponentA');
export const ComponentB = Symbol('ComponentB');
export const ComponentC = Symbol('ComponentC');
// Or, it can also be a string.
// export const ComponentA = 'ComponentA';
// export const ComponentB = 'ComponentB';
// export const ComponentC = 'ComponentC';
You can use the inject in your implementation with Babel. (TypeScript is unverified. We have plan to support.)
babel --optional es7.decorators
import wr from './register-dependencies';
import {
ComponentA,
ComponentB,
ComponentC
} from './module-keys';
@wr.inject({
ComponentA,
ComponentB,
ComponentC
})
export default class Application {
constructor() {
console.log(this.ComponentA); // ę ¼ē“ęøćæ
}
}
WrasseWrasse#set(key: string|Symbol, module: any): voidWrasse#inject(keys: {[key: string]: string|Symbol}): constructor @decoratableFAQs
JavaScript dependency injection with the Decorators syntax.
We found that wrasse 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
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.

Research
Active npm supply chain attack compromises @antv packages in a fast-moving malicious publish wave tied to Mini Shai-Hulud.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.