
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
轻量级的 Event Bus。
安装:
pnpm add ebus-light
使用方式有以下几种。
bus
是全局唯一的实例。
import { bus } from 'ebus-light';
bus.emit('foo', { name: 'yang' });
function onFoo(e) {
console.log(e.name);
}
bus.on('foo', onFoo)
bus.off('foo', onFoo)
也可当作 Vue
插件,先在 main.ts
中注册:
import { eventBus } from 'ebus-light';
app.use(eventBus);
在页面中使用:
// options API
export default {
mounted() {
this.$eventBus.emit('foo')
}
}
通过 inject
访问:
import `inject` from 'vue';
export default {
setup() {
const bus = inject('$eventBus');
bus.emit('foo');
}
}
通过插件方式使用时传递的参数:
export interface Options {
// 是否挂载在全局
global?: boolean;
// 是否 provide
inject?: boolean;
// 实例上挂载的名称
globalPropertyName?: string;
// 通过 inject 引入的名称
injectName?: string;
}
参数默认值:
const DEFAULT_OPTIONS = {
global: false,
inject: false,
globalPropertyName: '$eventBus',
injectName: '$eventBus',
};
FAQs
轻量级的 Event Bus
The npm package ebus-light receives a total of 34 weekly downloads. As such, ebus-light popularity was classified as not popular.
We found that ebus-light demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.