Using external Node libraries
External Libraries
External libraries enhance the functionality of your UI Bakery app by allowing you to use additional JavaScript code. Take advantage of a vast ecosystem of JavaScript libraries to bring date manipulation, data parsing, and much more into your automations.
Finding Libraries
Visit the npm website, the package manager for JavaScript and the world's largest software registry.
Search for a package, for example "XML parsing" to find libraries tailored to your requirements.
Select a library from the search results to view its details page.
Locate the version number in the Versions tab. It is recommended to use the most recent stable version listed.
Copy package name and version number from the Install tab and paste them as "package": "version" in the JSON packages configuration.
Libraries dependent on the fs
and child_process
modules are currently not supported.
Using Libraries in Your Code
Use import statements to include the libraries in your automations:
require() imports
require()
imports are not supported in Automations runtime. Please use the ES6 module import syntax instead. For modules using CommonJS 'require', replace it with an ES6 import
statement.
Before:
const yaml = require('js-yaml');
After:
import yaml from 'js-yaml';
Last updated