Hello everyone! I am new to serverless / aws lambda and I have a few questions I wanted to ask. First off, is it possible;e for my lambda functions to utilize a js library? For example, if I wanted to us a package called Figlet in my code like such:
module.exports.funny = async (event) => {
var figlet = require(‘figlet’);
let data = figlet(‘Hello World!!’, function (err, data) {
if (err) {
console.log(‘Something went wrong…’);
console.dir(err);
return;
}
return data;
});
return {
statusCode: 200,
headers: {
"Access-Control-Allow-Origin": "*", // Required for CORS support to work
"Access-Control-Allow-Credentials": true // Required for cookies, authorization headers with
HTTPS
},
data: JSON.stringify(data)
}
}
And if so, how do I achieve this? Thank you very much!