Closed Luke-Roy-IBM closed 1 year ago
Simple example that shows how the new functionality works
index.js
function main(args) {
const oneLinerJoke = require('./one-liner-joke');
let getRandomJoke = oneLinerJoke.getRandomJoke();
return {
body: getRandomJoke.body
}
}
module.exports.main = main;
package.json
{
"name": "my-action",
"main": "index.js",
"dependencies" : {
"one-liner-joke" : "1.2.2"
}
}
Install modules specified in package.json during initialisation as a alternative to packageing them. Detect if the node_modules directory is missing and installes the node modules.