
Product
Introducing Socket MCP for Claude Desktop
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
optimizely
Advanced tools
Runs optimizely experiments in node using either jsdom or cheerio + native node-vm
Runs optimizely experiments in node using either jsdom (node-0.10 only, full-featured, resource-hungry) or cheerio+node-vm (0.10 and 0.12, simple, lightweight)
npm install optimizely --save
// jsdom
var optimizely = require('optimizely')('jsdom');
// node vm
var optimizely = require('optimizely')('node_vm');
optimizely.setOptimizely(optimizelyCode);
// req - http request
// callback – return path out of this middleware
var originalHtml = getFinalHtmlBeforeResponse();
optimizely(req, originalHtml, function(err, modifiedHtml, extras)
{
// only pass error if html isn't returned
if (err && !html)
{
return callback(err);
}
// extras.images – array of image-src;
// extras.cookies – cookie object;
// return modified html
callback(null, html);
});
In jsdom processor trimmed version of jQuery is used, which is provided by optimizely itself and bundled with the module. In turn node_vm processor is relying on augmented cheerio module.
Module oven is used for cookie handling and it's cookie jar instance is returned in callback.
Method extras.cookies.getCookieHeader()
could be used to get cookie header formated string
and extras.cookies.getCookies()
to get list of cookie objects.
Along with creating new cookies, optimizely adds images to track performed experiments, to make it slim and less opinionated,
list of images passed to callback (extras.images
) instead of modifying html in place.
FAQs
Runs optimizely experiments in node using either jsdom or cheerio + native node-vm
The npm package optimizely receives a total of 0 weekly downloads. As such, optimizely popularity was classified as not popular.
We found that optimizely demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.