Flyde Nodes Library
This is the documentation for the Flyde Nodes Library. It contains all the parts that are available in the @flyde/stdlib (which is copied to @flyde/runtime for convenience).
For simplicity, all parts of Flyde's standard library reside in the same package, and is organized into namespaces.
Available sections:
Objects
Id | Description | Inputs | Outputs |
---|---|---|---|
JSON Parse | Parses a JSON string into an object | json: JSON string to parse (required) | object: The parsed object |
JSON Stringify | Stringifies an object into a JSON string | object: Object to stringify (required) | json: The stringified JSON |
Keys | Emits the keys of an object | object: Object to get keys of (required) | keys: The keys of object |
Values | Emits the values of an object | object: Object to get values of (required) | values: The values of object |
Entries | Emits the entries of an object | object: Object to get entries of (required) | entries: The entries of object |
Delete Attribute | Deletes an attribute from an object | object: Object to delete attribute from (required) attribute: Attribute to delete (required) | object: The object with the attribute deleted |
Numbers
Id | Description | Inputs | Outputs |
---|---|---|---|
Add | Emits the sum of two numbers | n1: First number to add (required) n2: Second number to add (required) | sum: The sum of n1 and n2 |
Subtract | Emits the difference of two numbers | n1: First number to subtract (required) n2: Second number to subtract (required) | difference: The difference of n1 and n2 |
Multiply | Emits the product of two numbers | n1: First number to multiply (required) n2: Second number to multiply (required) | product: The product of n1 and n2 |
Divide | Emits the quotient of two numbers | n1: First number to divide (required) n2: Second number to divide (required) | quotient: The quotient of n1 and n2 |
Modulo | Emits the remainder of two numbers | n1: First number to divide (required) n2: Second number to divide (required) | remainder: The remainder of n1 and n2 |
Power | Emits the power of two numbers | n1: Base number (required) n2: Exponent (required) | power: The power of n1 and n2 |
Square Root | Emits the square root of a number | n: Number to take the square root of (required) | root: The square root of n |
Absolute Value | Emits the absolute value of a number | n: Number to take the absolute value of (required) | absolute: The absolute value of n |
Floor | Emits the floor of a number | n: Number to take the floor of (required) | floor: The floor of n |
Ceiling | Emits the ceiling of a number | n: Number to take the ceiling of (required) | ceiling: The ceiling of n |
Round | Emits the rounded value of a number | n: Number to round (required) | rounded: The rounded value of n |
Truncate | Emits the truncated value of a number | n: Number to truncate (required) | truncated: The truncated value of n |
Sin | Emits the sine of an angle | angle: Angle in radians (required) | sine: The sine of angle |
Cos | Emits the cosine of an angle | angle: Angle in radians (required) | cosine: The cosine of angle |
Min | Emits the minimum of two numbers | n1: First number (required) n2: Second number (required) | min: The minimum of n1 and n2 |
Max | Emits the maximum of two numbers | n1: First number (required) n2: Second number (required) | max: The maximum of n1 and n2 |
Parse Int | Emits the integer value of a string | str: String to parse (required) | int: The integer value of str |
Parse Float | Emits the float value of a string | str: String to parse (required) | float: The float value of str |
To Fixed | Emits the specified number of decimal places of a number | number: Number to format (required) places: Number of decimal places to format to (required) | fixed: The number with the specified number of decimal places |
Greater Than | Emits true if the first number is greater than the second | n1: First number (required) n2: Second number (required) | result: true if n1 is greater than n2 |
Greater Than Or Equal | Emits true if the first number is greater than or equal to the second | n1: First number (required) n2: Second number (required) | result: true if n1 is greater than or equal to n2 |
Less Than | Emits true if the first number is less than the second | n1: First number (required) n2: Second number (required) | result: true if n1 is less than n2 |
Less Than Or Equal | Emits true if the first number is less than or equal to the second | n1: First number (required) n2: Second number (required) | result: true if n1 is less than or equal to n2 |
Sum List | Emits the sum of a list of numbers | list: List of numbers (required) | sum: The sum of the numbers in list |
Strings
Id | Description | Inputs | Outputs |
---|---|---|---|
Concat | Concatenates two strings | a: String a (required) b: String b (required) | value: Concatenated value |
Split | Splits a string | string: String to split (required) separator: Separator (required) | value: Splitted value |
Join | Joins an array of strings | array: Array to join (required) separator: Separator (required) | value: Joined value |
Replace | Replaces a string | string: String to replace (required) searchValue: Value to search for (required) replaceValue: Value to replace with (required) | value: Replaced value |
Trim | Trims a string | string: String to trim (required) | value: Trimmed value |
To Lower Case | Converts a string to lower case | string: String to convert to lower case (required) | value: Converted value |
To Upper Case | Converts a string to upper case | string: String to convert to upper case (required) | value: Converted value |
Substring | Returns the node of the string between the start and end indexes | string: String to get substring from (required) start: Start index (required) end: End index (required) | value: Substring |
Length | Returns the length of a string | string: String to get length from (required) | value: Length |
Index Of | Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex | string: String to search in (required) searchValue: Value to search for (required) fromIndex: Index to start searching from (required) | value: Index |
Last Index Of | Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found. The calling string is searched backward, starting at fromIndex | string: String to search in (required) searchValue: Value to search for (required) fromIndex: Index to start searching from (required) | value: Index |
Char At | Returns the character at the specified index | string: String to get character from (required) index: Index to get character from (required) | value: Character |
To Kebab Case | Converts a string to kebab case | string: String to convert to kebab case (required) | value: Converted value |
To Camel Case | Converts a string to camel case | string: String to convert to camel case (required) | value: Converted value |
To Pascal Case | Converts a string to pascal case | string: String to convert to pascal case (required) | value: Converted value |
To Snake Case | Converts a string to snake case | string: String to convert to snake case (required) | value: Converted value |
To Title Case | Converts a string to title case | string: String to convert to title case (required) | value: Converted value |
Includes | Determines whether one string may be found within another string, returning true or false as appropriate | string: String to search in (required) searchValue: Value to search for (required) fromIndex: Index to start searching from (required) | value: Result |
Starts With | Determines whether a string begins with the characters of another string, returning true or false as appropriate | string: String to search in (required) searchValue: Value to search for (required) fromIndex: Index to start searching from (required) | value: Result |
Ends With | Determines whether a string ends with the characters of another string, returning true or false as appropriate | string: String to search in (required) searchValue: Value to search for (required) fromIndex: Index to start searching from (required) | value: Result |
Is Empty | Determines whether a string is empty | string: String to check (required) | value: Result |
Match Regex | Determines whether a string matches a regular expression | string: String to check (required) regex: Regular expression to match (required) | value: Result |
Empty String | Creates an empty string | None | string: The empty string |
Control Flow
Id | Description | Inputs | Outputs |
---|---|---|---|
Limit Times | Item will be emitted until the limit is reached | item: The item to emit (required) times: The number of times to emit the item (required) reset: Reset the counter (optional) | ok: undefined |
Publish | Publishes a value by a key to all listeners in the current flow. Use 'Subscribe' to listen to events. | key: A key to use to subscribe to values (required) value: undefined (required) | None |
Subscribe | Subscribes to a value published by a key. Use 'Publish' to publish values. | key: A key to use to subscribe to values (required) initial: If passed will be published has the first value (required-if-connected) | value: The value published by the key |
Boolean Split | Splits a boolean value into two outputs | value: Boolean value (required) trueValue: Value to emit if the input is true. Defaults to true (required-if-connected) falseValue: Value to emit if the input is false. Defaults to false (required-if-connected) | true: The value is true false: The value is false |
Emit on Trigger | Emits the value when the trigger input receives any value | value: The value to emit (required) trigger: The trigger to emit the value (required) | result: The value emitted |
Lists
Id | Description | Inputs | Outputs |
---|---|---|---|
List Length | Returns the length of a list | list: List (required) | length: Length |
List Is Empty | Returns true if the list is empty | list: List (required) | isEmpty: Is empty |
Get List Element | Returns the element at the specified index | list: List (required) index: Index (required) | element: Element |
Repeat | Repeats a value a number of times | value: Value to repeat (required) times: How many times will the value be repeated (required) | list: List |
Concat Lists | Concatenates two lists | list1: First list (required) list2: Second list (required) | list: Concatenated list |
Reverse | Reverses a list | list: List (required) | reversed: Reversed list |
Loop List | Emits all values in a list | list: The list to loop (required) | item: Will emit a value for each item in the list index: Will emit the index of the item length: Will emit the length of the list |
Head and rest | Receives a list and emits two outputs: the first item and the rest of the list | list: The list (required) | head: The first item in the list rest: The rest of the list |
Accumulate Some Values by Count | Accumulates values sent to the "accept" input. Emits the list after the total items passed to both "accept" and "ignore" inputs reach the specified count. | accept: Values to accumulate (required) ignore: Values to ignore (required) count: Number of values to accumulate before emitting them (required) | accumulated: The accumulated accepted values ignored: The accumulated ignored values |
Append | Appends an item to a list | list: The list (required) item: The item to append (required) | list: The resulting list |
Prepend | Prepends an item to a list | list: The list (required) item: The item to prepend (required) | list: The resulting list |
Remove Item | Removes an item from a list | list: The list (required) item: The item to remove (required) | list: The resulting list |
Remove Item At | Removes an item from a list at the specified index | list: The list (required) index: The index of the item to remove (required) | list: The resulting list |
Slice | Returns a slice of a list from the specified start index to the specified end index | list: The list (required) start: The index to start slicing from (required) end: The index to end slicing at (required) | list: The resulting list |
Flatten | Flattens a list of lists into a single list | list: The list of lists (required) | list: The resulting list |
Console
Id | Description | Inputs | Outputs |
---|---|---|---|
Log | Logs a value to the console | value: Value to log (required) | None |
Dates
Id | Description | Inputs | Outputs |
---|---|---|---|
Now | Returns the current date and time | None | now: Current date and time |
Now String | Returns the current date and time as a string | None | now: Current date and time |
Now ISO String | Returns the current date and time as a string in ISO format | None | now: Current date and time |
Now Unix Time | Returns the current date and time as a Unix time | None | now: Current date and time |
Date From Unix Time | Creates a date from a Unix time | time: Unix time (required) | date: Date |
Date From String | Creates a date from a string | string: String (required) | date: Date |
Date From ISO String | Creates a date from an ISO string | string: String (required) | date: Date |
Date To String | Converts a date to a string | date: Date (required) | string: String |
Date To ISO String | Converts a date to an ISO string | date: Date (required) | string: String |
Date To Unix Time | Converts a date to a Unix time | date: Date (required) | time: Unix time |
Date To Year | Converts a date to a year | date: Date (required) | year: Year |
Month To Date | Converts a date to a month | date: Date (required) | month: Month |
Date To Day | Converts a date to a day | date: Date (required) | day: Day |
Date To Hours | Converts a date to hours | date: Date (required) | hours: Hours |
Date To Minutes | Converts a date to minutes | date: Date (required) | minutes: Minutes |
Date To Seconds | Converts a date to seconds | date: Date (required) | seconds: Seconds |
Date To Milliseconds | Converts a date to milliseconds | date: Date (required) | milliseconds: Milliseconds |
Date To Day Of Week | Converts a date to a day of the week | date: Date (required) | day: Day |
Date To Timezone Offset | Converts a date to a timezone offset | date: Date (required) | offset: Offset |
State
Id | Description | Inputs | Outputs |
---|---|---|---|
Set State | Sets a value in the global state | key: Key to set (required) value: Value to set (required) | setValue: Value that was set |
Get State | Gets a value from the global state | key: Key to get (required) defaultValue: Default value if key is not set (required-if-connected) | value: Value of the key |
MongoDB
Id | Description | Inputs | Outputs |
---|---|---|---|
Connect | Connects to a Mongo database and returns a client. Uses the "mongodb" package. | url: URL (required) options: A Valid MongoClientOptions object (required) | connection: Mongo connected client |
Find | Queries a Mongo database. Find receives a valid "mongodb" FindOptions object. | connection: Mongo connection (required) collection: Collection (required) query: Query (required) options: Options (required) | result: |
FindOne | Queries a Mongo database. FindOne receives a valid "mongodb" FindOneOptions object. | connection: Mongo connection (required) collection: Collection (required) query: Query (required) options: Options (required) | result: |
Disconnect | Disconnects from a Mongo database | connection: Mongo connection (required) | None |
InsertOne | Inserts one document into a Mongo database. InsertOne receives a valid "mongodb" InsertOneOptions object. | connection: Mongo connection (required) collection: Collection (required) document: Document (required) options: Options (required) | result: |
InsertMany | Inserts many documents into a Mongo database. InsertMany receives a valid "mongodb" InsertManyOptions object. | connection: Mongo connection (required) collection: Collection (required) documents: Documents (required) options: Options (required) | result: |
UpdateOne | Updates one document in a Mongo database. UpdateOne receives a valid "mongodb" UpdateOneOptions object. | connection: Mongo connection (required) collection: Collection (required) filter: Filter (required) update: Update (required) options: Options (required) | result: |
UpdateMany | Updates many documents in a Mongo database. UpdateMany receives a valid "mongodb" UpdateManyOptions object. | connection: Mongo connection (required) collection: Collection (required) filter: Filter (required) update: Update (required) options: Options (required) | result: |
DeleteOne | Deletes one document in a Mongo database. DeleteOne receives a valid "mongodb" DeleteOneOptions object. | connection: Mongo connection (required) collection: Collection (required) filter: Filter (required) options: Options (required) | result: |
DeleteMany | Deletes many documents in a Mongo database. DeleteMany receives a valid "mongodb" DeleteManyOptions object. | connection: Mongo connection (required) collection: Collection name (required) filter: Filter query (required) options: Query options (required) | result: |
CountDocuments | Counts documents in a Mongo database. CountDocuments receives a valid "mongodb" CountDocumentsOptions object. | connection: Mongo connection (required) collection: Collection (required) query: Query (required) options: Options (required) | result: |
CreateIndex | Creates an index in a Mongo database. CreateIndex receives a valid "mongodb" CreateIndexesOptions object. | connection: Mongo connection (required) collection: Collection (required) fieldOrSpec: Field or spec (required) options: Options (required) | result: |
CreateIndexes | Creates indexes in a Mongo database. CreateIndexes receives a valid "mongodb" CreateIndexesOptions object. | connection: Mongo connection (required) collection: Collection (required) indexes: Indexes (required) options: Options (required) | result: |
File System
Id | Description | Inputs | Outputs |
---|---|---|---|
Read File | Reads a file from the file system | path: Path to the file (required) encoding: Encoding of the file (optional) | contents: Contents of the file |
Write File | Writes a file to the file system | path: Path to the file (required) contents: Contents of the file (required) encoding: Encoding of the file (optional) | None |
Append File | Appends a file to the file system | path: Path to the file (required) contents: Contents of the file (required) encoding: Encoding of the file (optional) | None |
Delete File | Deletes a file from the file system | path: Path to the file (required) | None |
Exists | Checks if a file exists | path: Path to the file (required) | exists: Whether the file exists |
Postgres
Id | Description | Inputs | Outputs |
---|---|---|---|
Connect | Connects to a Postgres database and returns a client. Uses the "pg" package. | host: Host (required) port: Port (required) database: Database (required) user: User (required) password: Password (required) | connection: Postgres connected client |
Disconnect | Disconnects from a Postgres database | connection: Postgres connection (required) | None |
Query | Queries a Postgres database. Query receives a valid "pg" QueryConfig object. | connection: Postgres connection (required) query: Query (required) | result: valid "pg" QueryConfig object |