
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@gasket/plugin-dynamic-plugins
Advanced tools
Gasket plugin for dynamically adding plugins to Gasket
npm i @gasket/plugin-dynamic-plugins
Update your gasket
file plugin configuration:
// gasket.js
+ import pluginDynamicPlugins from '@gasket/plugin-dynamic-plugins';
export default makeGasket({
plugins: [
+ pluginDynamicPlugins
]
});
This plugin gives you the option to dynamically add plugins to Gasket after the core Gasket instance has been created.
This can be useful when you want to add plugins to Gasket for specific environments or commands.
For example, if you have plugins that are only needed for development,
such as the @gasket/plugin-docs
and @gasket/plugin-docusarus
plugins, you can
dynamically load them into Gasket during local development.
These plugins can then be designated for development by moving them to
devDependencies
in the package.json
file.
To specify which plugins to load dynamically,
in makeGasket
set the dynamicPlugins
prop to an array of strings
containing the plugin names you want to add.
// gasket.js
export default makeGasket({
+ dynamicPlugins: [
+ '@gasket/plugin-foo',
+ '@gasket/plugin-bar',
+ './custom-plugin.js'
+ ]
});
You can use sub-configurations by commands or environments to determine which plugins to load dynamically.
For example, if you wanted to load docs-related plugins only when using the docs commands, with a package script like:
"docs": "node gasket.js docs"
In your gasket
file, you would then configure the plugins to load dynamically
when the docs
command is used.
makeGasket({
// ...
commands: {
'docs': {
dynamicPlugins: [
'@gasket/plugin-docs',
'@gasket/plugin-docusaurus',
'@gasket/plugin-metadata'
]
}
}
})
If you wanted to load the plugins for only a specific environment, you would then configure the plugins to load dynamically for that environment.
makeGasket({
environments: {
local: {
dynamicPlugins: [
'@gasket/plugin-one',
'@gasket/plugin-two',
]
},
'local.custom.env': {
dynamicPlugins: [
'@gasket/plugin-three'
]
}
}
})
Basic gasket configuration is synchronous, but dynamic plugins will be loaded asynchronously.
If you want to wait until dynamic plugins have been loaded into the Gasket
instance before running app code or actions, you can do so by checking if the
isReady
property on the Gasket instance has been resolved.
export default {
name: 'example-plugin',
actions: {
async myAction(gasket) {
+ await gasket.isReady;
// do something async after dynamic plugins have been loaded
}
}
};
This plugin hooks the prepare lifecycle to add dynamic plugins to the Gasket instance.
In the prepare
hook, plugins specified in the dynamicPlugins
configuration
are registered with the Gasket instance.
The init
, configure
, and prepare
lifecycles are then executed exclusively
for the newly added dynamic plugins.
FAQs
Gasket plugin for dynamically adding plugins to Gasket
The npm package @gasket/plugin-dynamic-plugins receives a total of 510 weekly downloads. As such, @gasket/plugin-dynamic-plugins popularity was classified as not popular.
We found that @gasket/plugin-dynamic-plugins demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.