Nodes

String#

The String node in Magick allows you to input and output a string value. It is a fundamental node for working with textual data in your spells.

Inputs#

  • a (string, default: ""): The input string value.

Outputs#

  • result (string): The output string value, which is the same as the input string.

Configuration#

This node has no additional configuration options.

Usage#

  1. Add a String node to your spell.
  2. Connect the desired input string to the a input port. This can be a hardcoded string value, or the output from another node.
  3. The result output port will emit the same string value that was input.
  4. Connect the result output to the input of another node as needed in your spell.

Example#

Here's a simple example of how the String node can be used in a spell:

// Create a String node
const greetingNode = magick.addNode("String");
 
// Set the input string
greetingNode.inputs.a = "Hello, world!";
 
// Log the output string
const outputString = greetingNode.outputs.result;
console.log(outputString); // Output: "Hello, world!"

In this example, we create a String node, set its input to the string "Hello, world!", and then log the output string to the console.

Best Practices#

  • Use the String node whenever you need to input or pass along a string value in your spell.
  • Remember that the String node simply passes the input string through to the output unchanged. If you need to modify the string, use other nodes like Join Text or Slice Text.

Common Issues#

There are no common issues or gotchas to watch out for with the String node, as it is a very simple and straightforward node. Just ensure that you are providing a valid string input, and the node will function as expected.