
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
option-cache
Advanced tools
Simple API for managing options in JavaScript applications.
npm i option-cache --save
Create a new instance of Options
.
options
{Object}: Initialize with default options.Example:
var util = require('util');
var Options = require('options-cache');
function App(options) {
Options.call(this, options);
}
util.inherits(App, Options);
App.prototype.a = function(value) {
this.enable(value);
};
App.prototype.b = function(value) {
if (this.enabled(value)) {
// do something
}
};
Set or get an option.
key
{String}: The option name.value
{*}: The value to set.returns
{*}: Returns a value
when only key
is defined.app.option('a', true);
app.option('a');
//=> true
Check if key
is enabled (truthy).
key
{String}returns
: {Boolean}app.enabled('a');
//=> false
app.enable('a');
app.enabled('a');
//=> true
Check if key
is disabled (falsey).
key
{String}returns
{Boolean}: Returns true if key
is disabled.app.disabled('a');
//=> true
app.enable('a');
app.disabled('a');
//=> false
Enable key
.
key
{String}returns
{Object} Options
: to enable chainingExample
app.enable('a');
Disable key
.
key
{String}: The option to disable.returns
{Object} Options
: to enable chainingExample
app.disable('a');
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on November 15, 2014.
FAQs
Simple API for managing options in JavaScript applications.
We found that option-cache 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.