
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

/*
* @param {Function|Array<paramNames..,fn>} - param names are service names
*/
tendril.resolve(function (a, b, c) {
})
/*
* @typedef {Object} IncludeConfig
*
* @property {Boolean} [inject=true] - should attempt to inject function
* @property {Boolean} [lazy=true] - only load if required by a sub-service
*/
/*
* @param {String|Object} name - if object, keys are names and values services
* @param {Anything|Function} constructor - the service, or resolved
* @param {IncludeConfig} config
*/
tendril.include(name, service, config)
/*
* @typedef {Object} Crawl
*
* @property {String} path - absolute path of directory to crawl
* @property {String} [postfix=''] - String to append to filenames as services
* @property {Boolean} [lazy=true] - only load if required by another service
*/
/*
* crawl a directory
*
* @param {Array<Crawl>|Crawl} crawls
*/
tendril.crawl(crawls)
/*
* @param name - event name (e.g. serviceLoad)
* @param fn - callback fn -> { name: 'serviceName', instance: {Service} }
*/
tendril.on(name, fn)
/*
* Inspect the dependencies
* @param fn - callback fn -> {x: ['y', 'z'], y: ['z'], z: []}
* where x depends on y and z, y depends on z, and z depends
* on nothing.
*/
tendril.dependencies(fn)
var Tendril = require('tendril');
new Tendril()
.crawl([{
// where to look
path: __dirname+'/services',
// added to the end of module names for injection
postfix: 'Service',
lazy: true // default
}])
.resolve(function(abcService, xyzService) {
/* only named services loaded because of lazy flag */
});
// services/abc.js
module.exports = function(xyzService) {
return {
hello: 'world'
}
}
new Tendril()
.include('abcService', {hello: 'world'})
.include('xyzService', function(abcService){
return {
hello: 'world'
}
})
.resolve(function(abcService, xyzService) {
// services instantiated
});
new Tendril()
.include('serviceTwo', '2')
.resolve(['serviceTwo', 'tendril', function(serviceTwo____, ____tendril) {
}]);
new Tendril()
.include('serviceTwo', '2')
.include('serviceThree', '3')
// The current tendril instance can be injected, just like any other service
.resolve(function(serviceTwo, tendril) {
tendril(function(serviceThree) {
});
});
new Tendril()
.include({
serviceOneX: serviceOne,
serviceTwo: '2',
serviceThree: '3'
})
.resolve(function(serviceOneX) {
expect(serviceOneX.two).to.equal('2');
expect(serviceOneX.three).to.equal('3');
done();
});
new Tendril()
.include('serviceTwo', fn, true) // third optional param to include()
new Tendril()
.include('serviceTwo', fn, null, false)
new Tendril()
.include('null')
.resolve(function(nonExistent, nonExistent2) {
}, function(err) {
// Error: Tendril: Missing dependencies ["nonExistent","nonExistent2"]]
});
new Tendril()
.on('serviceLoad', function (service) {
/*
* {
* name: 'A',
* instance: {Object}
* }
*/
})
.include('A', 'a')
All subfolders in a module (with an index.js) are considered submodules and will attempt to be loaded
new Tendril()
.include('xyzService/oooService', function(abcService) {
return {
hello: 'world'
}
})
FAQs
Fancy Dependecy Injection
The npm package tendril receives a total of 48 weekly downloads. As such, tendril popularity was classified as not popular.
We found that tendril demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.