Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@skbkontur/simple-container
Advanced tools
Zero deps container
import SimpleContainer from '@skbkontur/SimpleContainer'
const hebrewFactory = ({ httpClient, log }) => ({
async brew() {
try {
await httpClient('/api/brew')
} catch (ex) {
log.error(ex)
}
}
})
const container = new SimpleContainer()
.registerFactory('hebrew', hebrewFactory)
.registerValue('httpClient', fetch.bind(global))
.registerValue('log', console)
const hebrew = container.resolve('hebrew')
hebrew.brew()
SimpleContainer
— class instantiates container
.registerValue(name, value)
— registers value in container
.registerClass(name, klass)
— registers class in container. When resolves,
instance would be created with cradle to constructor
.registerFactory(name, factory)
— registers factory function in container.
When resolves, function would be called with cradle passed to arguments
.resolve(name)
— resolves registered item
.cradle
— Proxy, which resolves items on property get. For example:
const hebrew = container.cradle.hebrew
// is the same as
const hebrew = cotainer.resolve('hebrew')
FAQs
Zero deps container
We found that @skbkontur/simple-container demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.