Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
@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
(or src/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.
The npm package @gasket/plugin-lifecycle receives a total of 158 weekly downloads. As such, @gasket/plugin-lifecycle popularity was classified as not popular.
We found that @gasket/plugin-lifecycle demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.