Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
hops-mixin
Advanced tools
hops-mixin
Please see the main Hops Readme for general information and a Getting Started Guide.
Contains the building blocks needed to build your own hops mixins. Mixins allow you to alter and extend Hops' functionality.
Tap into them using your own mixins and reconfigure Webpack, register additional Express middlewares and Yargs commands or fetch data to bootstrap your React application.
Please be aware that the mixin hooks are not part of the SemVer API contract. This means that hook methods and signatures can change even in minor releases. Therefore it's up to you to make sure that all hooks that you are using in your own mixins still adhere to the new implementation after an upgrade of a Hops packages.
npm install --save hops-mixin
If you don't already have an existing Hops project read this section on how to set up your first Hops project.
Base class to extend from when building a mixin. Ensures the config is available in this.config
.
const { Mixin } = require('hops-mixin');
class MyMixin extends Mixin {}
Strategies allow to define mixin hooks that are usable by other mixins. There are various types of strategies. callable
will make the method available to other mixins. Methods with strategy pipe
pass each implementation's output to the next, using the first argument as the initial value. All other arguments are being passed to all implementations as-is.
For a complete list of available strategies, have a look at the mixinable documentation.
A mixin that exposes a method to retrieve the build config.
const {
Mixin,
strategies: { sync: callable },
} = require('hops-mixin');
class BuildConfigMixin extends Mixin {
getBuildConfig() {
return this.buildConfig;
}
}
MyMixin.strategies = {
getBuildConfig: callable,
};
Other mixins are now able to call the method.
const { Mixin } = require('hops-mixin');
class ConsumerMixin extends Mixin {
myMethod() {
const config = this.getBuildConfig();
}
}
16.0.0-nightly.5 (2022-03-02)
Note: Version bump only for package hops-lerna-root
FAQs
Building blocks to build cusom hops mixins
The npm package hops-mixin receives a total of 167 weekly downloads. As such, hops-mixin popularity was classified as not popular.
We found that hops-mixin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.