JavaScript libraries

JavaScript actions support a number of popular JavaScript libraries. To import a package, use the require function:

const moment = require('moment');

You can also choose another name for the imported library:

const stringValidator = require('validator');
Supported JavaScript libraries

Library

Import

Description

CSV

csv

CSV generation, parsing, transformation and serialization

Files

files

Built-in API for File variable data

Lodash

_

Convenience functions for working with collections and values

moment

moment

Parse, validate, manipulate, and display dates; with Twix date range, and moment-business-days support

request

request

Simplified HTTP request client

Users

users

Built-in API for User variable data

validator

validator

String validation and sanitization

WebDAV client

webdav-client

Exchange files with a WebDAV endpoint

XML

xml-js

XML generation and parsing

Process Manager client

spm-client

Authenticates request to the Process Manager API automatically

The JavaScript action always imports the _ (Lodash) and request packages, for backwards compatibility.