Custom plugins allow you to extend the capabilities of the Profound.js low-code interface. They can be generic, similar to the plugins shipped with Profound.js, or specific to your business. Typically, an experienced Node.js developer or a 3rd party organization will write a reusable plugin, and then other developers at your company can use that plugin in a point-and-click manner to create applications.

Plugin File

A plugin is a Node.js module that exports a number of properties, including a generator function. For example:

module.exports = {
  name: "date-time-logger",
  text: "Log Date/Time",
  category: "My Plugins",  
  help: "This action outputs the current date and time to the console.",  

  generator: function(answers) {
    return `console.log(new Date());`;
  }
}

The custom plugin should be saved as a JavaScript file into the profoundjs/plugins directory, where profoundjs is the directory where you installed Profound.js.

If you're working in the cloud, using the Profound.js Spaces environment, you must create a plugins directory at the root of your workspace, and save the plugin file there.

After adding a plugin, you should restart your server and refresh the IDE.

The plugin will then appear in the low-code interface:

Plugin Properties

You can export the following properties from your plugin file:

Question Properties

Each question in the questions array is an object with the following possible properties: