Libraries & Functions
Lambdas become even more powerful when they can stand on the shoulders of world class libraries and functions developed by 3rd parties. Xano currently doesn't support loading arbitrary external libraries, but we do hand pick the most popular ones based on customer demand. If you have a favorite, then please let us now on our feedback board.
Lodash
The Lodash library is considered the Swiss Army Knife of transformation. If you are tasked with manipulating strings, numbers, objects, and/or arrays, then there is a good chance the lodash library can help.
This library is accessible within the Lambda through the library variable _
(the underscore character).
Here is an example of using the uniq
function of the lodash library to return an array of unique values.
Moment.js
The Moment.js library is a popular library used to parse, validate, transform, and format dates and time.
This library is accessible within the Lambda through the library variable moment
.
Here is an example showing how to parse an ISO 8601 formatted date, add 1 month, and then return the result in its original format.
Luxon
The Luxon library was built by one of the Moment.js's maintainers and is considered the next evolution of Moment.js.
This library is accessible within the Lambda through the library variable luxon
.
Here is an example showing how to parse an ISO 8601 formatted date, add 1 month, and then return the result in its original format.
Axios
The Axios library is a popular networking library for sending HTTP requests.
This library is accessible within the Lambda through the library variable axios
.
Here is an example showing how to retrieve a json response from GitHub's API.
Fetch
The Fetch library is another networking library for sending HTTP requests. It is built into current generation web browsers, which makes it very popular to use because there is no additional download required.
This library is accessible within the Lambda through the library variable fetch
.
Here is an example showing how to retrieve a json response from GitHub's API.
Math.js
The Math.js library provides support for advanced math formulas and expressions.
This library is accessible within the Lambda through the library variable math
. The standard JavaScript Math library is accessible through the variable Math
, so make sure you pay attention to case sensitivity, so that you are using the appropriate library.
Here is an example showing how to perform the negative square root of 4.
Crypto
The Crypto library is built into Node.js and useful for performing common routines related to cryptography.
This library is accessible within the Lambda through the library variable crypto
.
Here is an example showing how to perform a SHA 256 digital signature.
Nodemailer
The Nodemailer library provides support to send email using SMTP and other transport mechanisms.
This function is accessible within the Lambda through the function variable nodemailer
.
Here is an example showing how to send a test email through ethereal.email. This example is taken from the Nodemailer documentation.
Mailparser
The Mailparser library is an addon for Nodemailer.
This function is accessible within the Lambda through the function variable mailparser
.
Here is an example showing how to instantiate it.
Promisify
The Promisify function is built into Node.js and is useful for converting legacy callback routines into a Promise based variant. Promises are a standardization of how responses are received in asynchronous programming, which makes it possible to rely on shorthand keywords like async.
This function is commonly used along with the Crypto library for those wishing to use that library with Promises instead of callbacks.
This function is accessible within the Lambda through the function variable promisify
.
Here is an example showing how to use Promisify on the Crypto library to generate an HMAC secret key.
Node Libraries
The following node libraries are available within Xano's Lambda support: DNS, HTTP, HTTPS, and NET.
They are accessible within the Lambda through the function variables: dns
, http
, https
, and net
.
Here is an example showing how to create a custom https agent.
Socks
The Socks library is a fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5 protocols.
This library is accessible within the Lambda through the library variable socks
.
Here is an example showing how to create a connection.
Ethers.js
This library aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem.
This is accessible within the Lambda through the function variable ethers
.
Here is an example of formatting a number in Ether.
Azure/Identity
This library provides Azure Active Directory (Azure AD) token authentication through a set of convenient TokenCredential implementations.
This is accessible within the Lambda through the function variable azure.identity
.
Here is an example of generating default Azure credentials with Azure/Identity.
Azure/Service-Bus
Here is an example of generating a service bus client connection with Azure/Service-Bus.
This is accessible within the Lambda through the function variable azure.serviceBus
.
This library provides access to Azure Service Bus, which is a highly-reliable cloud messaging service from Microsoft.
Zeebe
This library is a Node.js gRPC client for Zeebe, the workflow engine in Camunda Platform 8.
This is accessible within the Lambda through the function variable zeebe
.
Here is an example of generating a timeout duration with Zeebe:
CryptoJS
This library is a Node.js package of crypto standards.
This is accessible within the Lambda through the function variable cryptojs
.
Here is an example of encrypting a string using CryptoJS:
UUID
This library is a Node.js package for the creation of RFC4122 UUID's
This is accessible within the Lambda through the function variable uuid
.
Here is an example of creating a UUID:
JWT: Jose
This library is JavaScript module for JSON Object Signing and Encryption, providing support for JSON Web Tokens (JWT), JSON Web Signature (JWS), JSON Web Encryption (JWE), JSON Web Key (JWK), JSON Web Key Set (JWKS), and more
This is accessible within the Lambda through the function variable jose
.
Here is an example of creating a signed JWT:
Fast XML Parser
This library is a Node.js package for being able to parse, build, and validate XML.
This is accessible within the Lambda through the function variable fastXmlParser
.
Here is an example of parsing an XML string:
AWS4: Sign Request Signatures
This library is a Node.js package for signing http/https requests using AWS Signature Version 4.
This is accessible within the Lambda through the function variable aws4
.
Here is an example of parsing an XML string:
Last updated