Utils
Utils provides common tools as blocks, with functions including data parsing, calculations, local storage, and log output.
json to text
json to text converts a JSON JavaScript object into text. The JSON JavaScript object (variable) is connected to the right-side input socket. The block outputs the converted text.
Attributes
- format - By default, it is converted to continuous text; if selected, the text will be formatted with spaces and line breaks for easier reading.
json parse
json parse parses JSON-formatted text into a JavaScript object. The text in JSON format is connected to the right-side input socket. The block outputs the converted JavaScript object, which can be saved to a variable.
json get path
json get path extracts specific content from a JSON object. The path parameter is connected to the right-side input socket. The block outputs the specified data (an object or an array). This uses JSONPath; see github.com/JSONPath for path definitions.
Attributes
- json - Variable storing the JSON JavaScript object.
create object url
create object url creates a URL string for the parameter object. The parameter can be a JavaScript File or Blob object, connected to the right-side input socket. The block outputs the URL string. This block is commonly used to convert image data in Blob form to a URL string that can be used as the URL source (src) of an image block.
revoke object url
revoke object url releases the object URL created by create object url. The object URL to be released is connected to the right-side input socket. It is recommended to release object URLs that are no longer used so the browser can free up resources.
load from local
load from local reads data saved in the browser's local storage using a key. Set the key name with the key attribute, and the block returns the corresponding text value.
Attributes
- key - The key name to read (unique identifier of the data).
save to local
save to local saves text data as a key-value pair in the browser's local storage. Connect the text data to be saved to the text socket.
Attributes
- key - The key name used for saving (unique identifier of the data).
show toast
show toast displays a message that closes automatically after a short time. You can specify the message type, and the text message to be displayed is connected to the right-side input socket.
Attributes
- type - Message type:
info
warning
danger
success
primary
secondary
log
log outputs debugging information to the browser's console. The data to be output is connected to the right parameter socket.