
Security News
npm Introduces minimumReleaseAge and Bulk OIDC Configuration
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.
Immutable dependency injection in Node.js inspired (very) heavily by Component.
npm install --save entwine
let entwine = require('entwine');
//
// Database component
//
class Database extends entwine.component({config: {}, conn: nul}) {
start() {
let self = this;
return connectToDatabase(this.config).then(conn => self.set('conn', conn));
}
stop() {
let self = this;
return disconnectFromDatabase(this.conn).then(() => self.remove('conn'));
}
}
function database(config) {
return new Database({config: config});
}
//
// Server component
//
class Server extends entwine.component({config: {}, socket: null, database: null}) {
start() {
let self = this;
return listenOnPort(this.config).then(socket => self.set('socket', socket));
}
stop() {
let self = this;
return unlistenOnPort(this.config).then(() => self.remove('socket'));
}
}
function server(config) {
return new Server({config: config});
}
//
// System
//
entwine.system({
server: server(serverConfig),
database: database(databaseConfig)
},{
server: ['database']
}).start().then(s => {
console.log('system started');
return s.stop();
}).then(() => {
console.log('system stopped');
});
FAQs
Immutable Dependency Injection
We found that entwine 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.

Security News
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.

Research
/Security News
Socket uncovered four malicious NuGet packages targeting ASP.NET apps, using a typosquatted dropper and localhost proxy to steal Identity data and backdoor apps.