![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Lightweight application extensibility and composition with a twist of feature reflection.
Lightweight application extensibility and composition with a twist of feature reflection.
var broadway = require("broadway");
var app = new broadway.App();
// Passes the second argument to `helloworld.attach`.
app.use(require("./plugins/helloworld"), { "delimiter": "!" } );
app.init(function (err) {
if (err) {
console.log(err);
}
});
app.hello("world");
// `exports.attach` gets called by broadway on `app.use`
exports.attach = function (options) {
this.hello = function (world) {
console.log("Hello "+ world + options.delimiter || ".");
};
};
// `exports.init` gets called by broadway on `app.init`.
exports.init = function (done) {
// This plugin doesn't require any initialization step.
return done();
};
josh@onix:~/dev/broadway/examples$ node simple/app.js
Hello world!
josh@onix:~/dev/broadway/examples$
$ curl http://npmjs.org/install.sh | sh
$ [sudo] npm install broadway
Initialize application and it's plugins, callback
will be called with null or
initialization error as first argument.
Attach plugin to application. plugin
should conform to following interface:
var plugin = {
"name": "example-plugin", // Plugin's name
"attach": function attach(options) {
// Called with plugin options once plugin attached to application
// `this` - is a reference to application
},
"detach": function detach() {
// Called when plugin detached from application
// (Only if plugin with same name was attached)
// `this` - is a reference to application
},
"init": function init(callback) {
// Called on application initialization
// App#init(callback) will be called once every plugin will call `callback`
// `this` - is a reference to application
}
};
App inherits from EventEmitter2, and many plugins build on this functionality.
error:init
: Broadway emits this event when it throws an error while attempting to initialize.Read the EventEmitter2 documentation for more information.
All tests are written with vows and should be run with npm:
$ npm test
FAQs
Lightweight App extensibility and hookable middleware customization.
The npm package broadway receives a total of 62,938 weekly downloads. As such, broadway popularity was classified as popular.
We found that broadway 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.