Twilio Function Packages is an integrated package manager that handles the retrieval, installation, and deployment of third-party packages to Functions. Today, Function Packages supports NPM, the default package manager for the node.js ecosystem. Function Packages enables developers to access an incredible collection of packages provided by the node.js community.
Function Packages makes it easy to use NPM by handling the retrieval, installation, and deployment of modules. Developers start by specifying the NPM modules they want in the Console. After that, developers can start using these NPM modules inside Functions by including them with the
require() method. To minimize maintenance and support headaches Functions will deploy every change to the NPM list instantly, ensuring the Function Environment stays consistent and up-to-date.
To make building applications easier Function Packages includes the following NPM modules by default.
- Native Packages Not Supported - Functions does not provide a C/C++ compliler required to complie native addon modules. This means modules that depend on
node-gypcan not be installed to Functions.
- 20 NPM Modules Limit - During public beta, developers will be limited to installing 20 NPM modules. To raise these limits during public beta, please contact Twilio Support.
Developers can add, remove and update Function Packages through the Console. Function Packages can be found in Functions Settings under the ‘Dependencies’ header. This list includes all of the NPM modules currently installed in the Functions Environment.
- Click the plus (“+”) button at the top of the Packages list. This will add a new row to the Packages table.
- Enter the name and version of the NPM module you want to include in the new row.
- Click "Save." This will install and deploy the NPM module to the Functions Environment.
- Click the “x” on NPM module that you want to remove from your Packages list.
- Click "Save." The NPM module will be uninstalled, and the Functions Environment will be deployed to complete the removal.
- Find the NPM module you want to update in the Packages list. Then enter the new version you want to use in the 'Version' field.
- Click "Save." This will update the version of the NPM module and deploy the Functions Environment with the specified version.
To send feedback and discuss implementation details, please join our Google group and let us know how things are going!