For inputs and outputs, you can define what type of data to take and how many.
You can define whether you want to receive input and output as Item or List, where Item is a single piece of data and List is an array of data.
An instance of the class DataAccess is passed to the program with the access variable, so input and output can be handled via this instance.
The following example shows a simple implementation of a Custom Node.
- Have two numeric inputs, receiving the 0th as Item and the 1st as List.
- Have two numeric outputs, writing out the 0th as List and the 1st as Item
// access: instance of DataAccess // receive the 0th input in Item formatlet x = access.getData(0); // receive the 1th input in List formatlet numbers = access.getDataList(1); // write out the 0th output data in List formatlet result = numbers.map(i => i * x);access.setDataList(0, result); // write out the 1th output data in Item formatlet max = Math.max(...result);access.setData(1, max);