Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
featuretoggle-client-node
Advanced tools
A node client to retrieve feature toggles stored in Etcd.
npm install featuretoggle-client-node
var Client = require('featuretoggle-client-node');
var client = new Client("application-name", {
etcdHost: "127.0.0.1",
etcdPort: 4001,
cacheIntervalMs: 60000
});
client.on("error", function(err) {
console.log(err);
});
client.on("initialized", function() {
client.get("toggle1", function(err, value) {
console.log(value);
});
client.getOrDefault("toggle2", true, function(err, value) {
console.log(value);
});
});
The "error" event must be subscribed to, otherwise errors will cause the application to exit
client.on("error", function(err) { });
Feature toggles are stored in Etcd using the following convention:
http://host:port/v2/keys/v1/toggles/applicationName/toggleName
Creates a new feature toggle client
var Client = require("featuretoggle-client-node");
var client = new Client("application-name", { etcdHost: "127.0.0.1" });
applicationName
the name of the application used to find feature togglesconfig
(optional)
etcdHost
(default: "127.0.0.1")etcdPort
(default: 4001)cacheIntervalMs
interval for the cache update, which loads all the applications toggles into memory (default: 60000)Subscribs to events emitted by the client.
error
[required]initialized
updating-cache
updated-cache
Gets the value of a feature toggle (true
or false
) if exists, otherwise return null
toggleName
the name of the toggle, used with the application name to get the feature toggle valuecallback
function with parameters (err
, value
)Gets the value of a feature toggle (true
or false
) if exists, otherwise return the default value (true
or false
)
toggleName
the name of the toggle, used with the application name to get the feature toggle valuedefaultValue
the value to return if the toggle value is not found or if there is an errorcallback
function with parameters (err
, value
)FAQs
feature toggle client for node
The npm package featuretoggle-client-node receives a total of 0 weekly downloads. As such, featuretoggle-client-node popularity was classified as not popular.
We found that featuretoggle-client-node 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.