
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@gasket/plugin-lifecycle
Advanced tools
Allows a gasket/ directory to be used for lifecycle hooks in applications.
Hook Gasket lifecycles using files in a lifecycles/
directory.
This is a default plugin in the Gasket CLI and is always available for use.
Create a lifecycles
folder in the root of your application. This folder should
contain files that can interact with the various of Gasket lifecycles that are
implemented by the plugins.
The name of the file (excluding the .js
extension) is used as the name of the
lifecycle event and the exported function of that file is used as handler of the
event. So you end up with the following application structure:
gasket.config.js
pages/
lifecycles/
express.js
middleware.js
webpack.js
In the example above we register to 3 different lifecycle hooks:
express
middleware
webpack
Each of these files export a function that is called when the lifecycle is
executed. For example, for middleware
the file could look like:
const cors = require('access-control');
/**
* Introduce new middleware layers to the stack.
*
* @param {Gasket} gasket Reference to the gasket instance
*/
module.exports = function middleware(gasket) {
return cors({
maxAge: '1 hour',
credentials: true,
origins: 'http://example.com'
});
};
It is recommended that you use kebab-case
or snake_case
naming conventions
for multi-word lifecycle events to avoid problems with case sensitivity in
different file systems. This plugin will automatically map these to the
camelCased
event names. For example, /lifecycles/app-env-config.js
will
properly hook appEnvConfig
events.
FAQs
Allows a gasket/ directory to be used for lifecycle hooks in applications.
We found that @gasket/plugin-lifecycle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers 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
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.