
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.
@blaze/toggles
Advanced tools
Blaze is a framework-free open source UI toolkit. It provides great structure for building websites quickly with a scalable and maintainable foundation.
Add the following to your <head></head>
.
<script src="https://unpkg.com/@blaze/toggles@x.x.x/dist/collection/config.js"></script>
<script src="https://unpkg.com/@blaze/toggles@x.x.x/dist/toggles.js"></script>
The x.x.x
is the specific version of the library, you should use specifc versions to prevent against breaking changes.
Next add some feature toggle config, e.g.
FeatureToggles.set({
welcomeMessage: true,
loginPage: {
rememberMe: 'alpha',
},
});
You can call FeatureToggles.set({...})
at anytime to update config. Everytime FeatureToggles.set is called it raises a featureToggleChange
event that you can hook into.
set
also merges the config with the already set config.
Config values can be either booleans
, strings
or functions
.
Promises
are supported.
e.g. the below to toggle the feature after 2 seconds once the promise has resolved.
FeatureToggles.set({
welcomeMessage: true,
loginPage: {
rememberMe: () => new Promise((resolve) => setTimeout(() => resolve('alpha'), 2000)),
},
});
<feature-toggle feature="welcomeMessage">
content will be VISIBLE
</feature-toggle>
<feature-toggle feature="loginPage.rememberMe" variant="alpha">
content will be VISIBLE
</feature-toggle>
<feature-toggle feature="loginPage.rememberMe" variant="beta">
content will be HIDDEN
</feature-toggle>
Setting | Description |
---|---|
feature | Feature config item, supports dot notation |
variant | The value the toggle must be to turn on this feature (default: true ) |
FAQs
Open Source UI Toolkit - Feature Toggles
The npm package @blaze/toggles receives a total of 11 weekly downloads. As such, @blaze/toggles popularity was classified as not popular.
We found that @blaze/toggles 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
/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.