Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A event bus for Vue.js, support both Vue 1.0 and 2.0. See Vue documentation for more detail.
You can install it via yarn or npm.
$ yarn add vue-bus
$ npm install vue-bus --save
And it's available on jsdelivr or unpkg.
<!-- development version -->
<script src="https://cdn.jsdelivr.net/npm/vue-bus/dist/vue-bus.js"></script>
<!-- production version -->
<script src="https://cdn.jsdelivr.net/npm/vue-bus/dist/vue-bus.min.js"></script>
When used with a module system, you must explicitly install the bus via Vue.use():
import Vue from 'vue';
import VueBus from 'vue-bus';
Vue.use(VueBus);
You don't need to do this when using global script tags.
// ...
created() {
this.$bus.on('add-todo', this.addTodo);
this.$bus.once('once', () => console.log('This listener will only fire once'));
},
beforeDestroy() {
this.$bus.off('add-todo', this.addTodo);
},
methods: {
addTodo(newTodo) {
this.todos.push(newTodo);
}
}
// ...
methods: {
addTodo() {
this.$bus.emit('add-todo', { text: this.newTodoText });
this.$bus.emit('once');
this.newTodoText = '';
}
}
// xxx.js
import Vue from 'vue';
Vue.bus.emit('someEvent');
Note: on
once
off
emit
are aliases for $on
$once
$off
$emit
. See the API for more detail.
FAQs
A event bus for Vue.js
The npm package vue-bus receives a total of 7,710 weekly downloads. As such, vue-bus popularity was classified as popular.
We found that vue-bus 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.