Taken from https://github.com/Azure/brigade/blob/master/docs/topics/workers.md

If you need different dependencies for every Brigade project, this can be easily achieved using a brigade.json file placed side-by-side the brigade.js file. This file contains the dependency name and version, and has the following structure:

{
    "dependencies": {
        "is-thirteen": "2.0.0"
    }
}

Before starting to execute the brigade.js script, the worker will install the
dependencies using yarn, adding them to the node_modules folder.

Then, in the brigade.js file, the new dependency can be used just like any other NodeJS dependency:

const { events } = require("brigadier")
const is = require("is-thirteen");

events.on("exec", function (e, p) {
    console.log("is 13 thirteen? " + is(13).thirteen());
})