Skip to content

Instantly share code, notes, and snippets.

@keithwhor
Created June 7, 2017 08:51
Show Gist options
  • Save keithwhor/041bf4ecce00af9de0f5f8cfdb8c6130 to your computer and use it in GitHub Desktop.
Save keithwhor/041bf4ecce00af9de0f5f8cfdb8c6130 to your computer and use it in GitHub Desktop.
FaaSlang Example Function
/**
* This is a FaaSlang-compliant function. It uses a modified ESDoc/JSDoc
* parser to read comments and determine types to implement type-safety
* mechanisms at execution time, or can intuit types based on default.
* It also performs static analysis to ensure comments match function footprints.
* @param {string} name Your name
* @param {string} age Your age
* @returns {string}
*/
module.exports = (name = 'Arya Stark', age = 18, context, callback) => {
callback(null, `Hello ${name}, you are ${age} years old.`);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment