Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@cap-js-community/feature-toggle-library
Advanced tools
SAP BTP feature toggle library enables Node.js applications using the SAP Cloud Application Programming Model to maintain live-updatable feature toggles via Redis.
SAP BTP feature toggle library enables Node.js applications using the SAP Cloud Application Programming Model to maintain live-updatable feature toggles via Redis.
Set up project with @sap/cds
.
Install library:
npm install --save @cap-js-community/feature-toggle-library
For CAP Feature Toggles everything is configured automatically.
The library acts as a CDS-Plugin and registers a FeatureService
, which can be used to check and update toggles.
For details see Example CAP Server.
Same as previous section.
Write toggles.yaml
configuration file:
# info: check api priority; 0 means access is disabled
/check/priority:
type: number
fallbackValue: 0
validations:
- scopes: [user, tenant]
- regex: '^\d+$'
Add configuration path to package.json
:
{
"cds": {
"featureToggles": {
"configFile": "./toggles.yaml"
}
}
}
Write usage code in handlers:
const toggles = require("@cap-js-community/feature-toggle-library");
const priorityHandler = async (context) => {
const user = context.user.id;
const tenant = context.tenant;
const value = toggles.getFeatureValue("/check/priority", { user, tenant });
if (value <= 0) {
return context.reject("blocked");
} else if (value < 10) {
return context.reply("welcome");
} else {
return context.reply("very welcome");
}
};
Head over to our Documentation to learn more.
This project is open to feature requests/suggestions, bug reports etc. via GitHub issues. Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.
Copyright 2023 SAP SE or an SAP affiliate company and feature-toggle-library contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.
v1.2.2 - 2024-11-14
FAQs
SAP BTP feature toggle library enables Node.js applications using the SAP Cloud Application Programming Model to maintain live-updatable feature toggles via Redis.
The npm package @cap-js-community/feature-toggle-library receives a total of 11 weekly downloads. As such, @cap-js-community/feature-toggle-library popularity was classified as not popular.
We found that @cap-js-community/feature-toggle-library 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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.