Node Modules

Description

Node modules can be called from Node Services and other Node modules.

Discussion

Node modules can be created and managed from within Alpha Anywhere. The Node modules category in the Web Projects Control Panel will filter the project to display node modules in the project. A Node module can be created using the New toolbar button. Node modules can also be added from the Node menu in the More... options on the Web Projects Control Panel toolbar.

While Node Modules cannot be directly called using Xbasic, they can be used by Node Services. Node Services can be called from Xbasic scripts. See Node Services for more information.

 Creating a New Node Module

When the Node category in the Web Projects Control Panel is selected, the New button will prompt you to create a new Node Service, Node Module, or Node API.

  1. Select the Node category in the Web Projects Control Panel.

  2. Click the New button in the Web Projects Control Panel toolbar.

  3. Select Create a new Node Module Javascript file from the New Node Javascript File dialog:

  4. In the Create Node Module Stub dialog, enter a Module name. Optionally check (or uncheck) the Open module definition .js file after creating it? checkbox. Click OK.

  5. Alpha Anywhere will generate a Node Module stub. The stub includes comments that describe how to call the Node Module from Xbasic.

    Create your Node Module. Save your changes.