
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Easter eggs as a service
This utility creates a very basic skelton with which easter eggs can be injected into apps or websites running JavaScript.
Use at own risk.
yarn add eeaas
Once installed you can import the utility and start creating your own easter eggs.
yarn add eeaas-snake
yarn add eeaas-nyancat
import Eeaas from 'eeaas';
import Snake from 'eeaas-snake';
import Nyancat from 'eeaas-nyancat';
// Register the eggs, only registered eggs can be activated
Eeaas.register(Snake);
Eeaas.register(Nyancat);
// Enable all keylisteners (start triggers) for all eggs
Eeaas.enable();
That's about it. Once enabled, all eggs will listen until triggered. In this example, if you included snake and nyancat, you can test out the easter eggs by typing "snake" and "nyan" respectively to trigger them (use "esc" to cancel the easter eggs).
At its core eeaas provides a key listener and a basic event handler for adding and removing key listeners (or start triggers). Eeaas is not limited to key listeners. Any logic to trigger an easter egg can be used.
Importing eeaas won't add any easter eggs to your app/website. You'll have to write your own or import the default eggs to get started.
To make an egg available it has to be registered with eeaas. You can do so by running Eeaas.register(MyEgg)
, where MyEgg
refers to an object. Once the egg is registered you can enable the egg by running Eeaas.enable()
. You can also individually enable or disable eggs by calling the enable()
or disable
methods explicitly on the egg itself, e.g. Eeaas.Eggs.MyEgg.enable()
or Eeaas.Eggs.MyEgg.disable()
.
If you provided a startTrigger
which is a string then typing the keys in the provided startTrigger
will call the egg's start
method. The enable()
and disable()
methods are safety wrappers which ensure that the eggs are only ever triggerable when the eggs themselves are "enabled".
If an egg is disabled it will be available but won't be triggereable via the startTrigger
. You can always manually trigger eggs via the code. So even if an egg is disabled, calling Eeaas.Eggs.MyEgg.start()
will run the egg.
export default {
name: 'MyEgg', // Required, this name is used as the namespace for the easter egg
startTrigger: 'secretstring', // Required, must be as string, an array of strings or a function
stopTrigger: 'esc', // Optional, must be a string, an array of strings or a function
start() { ... }, // Required, contains all logic for the easter egg and attaches necessary elements to the DOM
stop() { ... } // Optional, contains logic to remove the easter egg functionality and the attached DOM elements
};
Method | Description |
---|---|
register() | Used to add easter eggs to the eeaas container. |
enable() | Used to add the keylisteners (start triggers) for all easter eggs. Can also be used on eggs individually. |
disable() | Used to remove the keylisteners (start triggers) for all easter eggs. Can also be used on eggs individually. |
Example:
import Eeaas from 'eeaas';
import Snake from 'eeaas-snake';
import Nyancat from 'eeaas-nyancat';
Eeaas.register(Snake);
Eeaas.register(Nyancat);
// Only enable "Snake"
Eeaas.Eggs.Snake.enable();
// Enable all eggs
Eeaas.enable();
// Disable "Snake"
Eeaas.Eggs.Snake.disable();
// Disable all eggs
Eeaas.disable();
FAQs
Easter eggs as a service
We found that eeaas 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.