Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
vue-easter-egg-trigger
Advanced tools
This packages makes it nice and easy to add Easter Egg triggers to your Vue site.
This packages makes it nice and easy to add Easter Egg triggers to your Vue site.
npm i vue-easter-egg-trigger
import Vue from 'vue';
import EasterEggTrigger from 'vue-easter-egg-trigger';
Vue.use(EasterEggTrigger);
Name | Type | Default | Description |
---|---|---|---|
delay | Integer | 500 | Determines the timeout before the event lister resets. |
keys | Array | ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'b', 'a'] | The key/click combination a user does to trigger easter egg. The default combination is the konami code. |
pattern | Array | [38, 38, 40, 40, 37, 39, 37, 39, 66, 65] | The key combination a user does to trigger easter egg. (fallback for keys) |
type | String | keydown | The type of action the trigger will be listening for. |
import Vue from 'vue';
import EasterEggTrigger from 'vue-easter-egg-trigger';
Vue.use(EasterEggTrigger, {
delay: 1000,
keys: ['ArrowUp', 'ArrowDown'],
pattern: [38, 40],
type: 'keyup'
});
Name | Type | Default | Description |
---|---|---|---|
callback | Function | null | The callback function |
destroyBus | Boolean | false | Determines if a bus $on event is destroyed automatically |
keys | Array | false | The key/click combination a user does to trigger easter egg. |
name | String | easter-egg | Identifier & used for even bus callback |
pattern | Array | false | The key combination a user does to trigger easter egg. (fallback for keys) |
target | String | div | Use this to target DOM elements, Id's, or Class Names. Used with click events. |
withBus | Boolean | true | Determines if a bus event is emitted |
There are two instance methods available to use.
$easterEgg
$easterEggTrigger
The default key combination to trigger the easter egg is the Konami Code.
ex. ↑ ↑ ↓ ↓ ← → ← → b a
this.$bus.$on('easter-egg', () => {
// do something...
});
this.$easterEgg();
this.$bus.$on('easter-egg', () => {
// also do something...
});
this.$easterEgg({
name: 'easter-egg',
callback() {
// do something ...
},
});
this.$easterEgg({
name: 'easter-egg',
callback() {
// do something ...
},
withBus: false,
});
First you will need to set the type in the plugin options.
Available types of Mouse Events: click
, dblclick
, mouseup
, mousedown
.
When using dblclick
the pattern will only work with one double click. Ex. pattern: ['dblclick']
import Vue from 'vue';
import EasterEggTrigger from 'vue-easter-egg-trigger';
Vue.use(EasterEggTrigger, {
type: 'click'
});
this.$bus.$on('easter-egg', () => {
// also do something...
});
this.$easterEgg({
name: 'easter-egg',
pattern: ['click', 'click'],
callback() {
// do something...
},
});
this.$easterEgg({
name: 'easter-egg',
pattern: ['click', 'click'],
target: 'h1',
});
this.$easterEgg({
name: 'easter-egg',
pattern: ['click', 'click'],
target: '#foo',
});
this.$easterEgg({
name: 'easter-egg',
pattern: ['click', 'click'],
target: '.foo',
});
You can find more examples in the EasterEgg.vue file.
Coming soon to a farm near you.
Copyright (c) 2021 WebDevNerdStuff Licensed under the MIT license.
FAQs
This packages makes it nice and easy to add Easter Egg triggers to your Vue site.
The npm package vue-easter-egg-trigger receives a total of 3 weekly downloads. As such, vue-easter-egg-trigger popularity was classified as not popular.
We found that vue-easter-egg-trigger 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.