
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
electrolyte-decorator
Advanced tools
Handy reflection and annotation utility for electrolyte components.
Handy wrappers for annotating electrolyte components by reflecting dependencies from the factory method parameter list.
components/settings.js
import { Annotations, decorate } from 'electrolyte-decorator'
// Note the Annotations.Singleton reference being passed as the last argument
// into the decorate method. The decorate method has a signature of:
//
// (Function componentFactory, ... Function componentAnnotations)
//
// This allows us to pass any number (including 0!) of annotations we want to
// apply to our componentFactory. Annotations are Functions that take zero
// arguments and return an object whose keys and values should be assigned onto
// the target function when applied.
//
// This package only supports the @require and @singleton annotations that
// electrolyte ships with. If more annotations are added in the future,
// it is trivial to add support for them.
module.exports = decorate(function () {
return {
sqliteFile: ':memory:'
}
}, Annotations.Singleton)
components/sqlite.js
import sqlite3 from 'sqlite3'
import { decorate } from 'electrolyte-decorator'
// The decorate method inspects the name of the declared function arguments
// and automatically manages setting them for this component.
// This is a shorthand for module.exports['@require'] = [ 'settings' ]
module.exports = decorate(function (settings) {
return new sqlite3.Database(settings.sqliteFile)
})
FAQs
Handy reflection and annotation utility for electrolyte components.
The npm package electrolyte-decorator receives a total of 1 weekly downloads. As such, electrolyte-decorator popularity was classified as not popular.
We found that electrolyte-decorator 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.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.