Skip to main content

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

IdDescriptionInputsOutputs
Get AttributeGets an attribute from an object
object: Object to get attribute from (required)
attribute: Attribute to get (required)
value: The value of the attribute
JSON ParseParses a JSON string into an object
json: JSON string to parse (required)
object: The parsed object
JSON StringifyStringifies an object into a JSON string
object: Object to stringify (required)
json: The stringified JSON
KeysEmits the keys of an object
object: Object to get keys of (required)
keys: The keys of object
ValuesEmits the values of an object
object: Object to get values of (required)
values: The values of object
EntriesEmits the entries of an object
object: Object to get entries of (required)
entries: The entries of object
Set AttributeSets an attribute on an object
object: Object to set attribute on (required)
attribute: Attribute to set (required)
value: Value to set attribute to (required)
object: The object with the attribute set
Delete AttributeDeletes 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

IdDescriptionInputsOutputs
AddEmits the sum of two numbers
n1: First number to add (required)
n2: Second number to add (required)
sum: The sum of n1 and n2
SubtractEmits the difference of two numbers
n1: First number to subtract (required)
n2: Second number to subtract (required)
difference: The difference of n1 and n2
MultiplyEmits the product of two numbers
n1: First number to multiply (required)
n2: Second number to multiply (required)
product: The product of n1 and n2
DivideEmits the quotient of two numbers
n1: First number to divide (required)
n2: Second number to divide (required)
quotient: The quotient of n1 and n2
ModuloEmits the remainder of two numbers
n1: First number to divide (required)
n2: Second number to divide (required)
remainder: The remainder of n1 and n2
PowerEmits the power of two numbers
n1: Base number (required)
n2: Exponent (required)
power: The power of n1 and n2
Square RootEmits the square root of a number
n: Number to take the square root of (required)
root: The square root of n
Absolute ValueEmits the absolute value of a number
n: Number to take the absolute value of (required)
absolute: The absolute value of n
FloorEmits the floor of a number
n: Number to take the floor of (required)
floor: The floor of n
CeilingEmits the ceiling of a number
n: Number to take the ceiling of (required)
ceiling: The ceiling of n
RoundEmits the rounded value of a number
n: Number to round (required)
rounded: The rounded value of n
TruncateEmits the truncated value of a number
n: Number to truncate (required)
truncated: The truncated value of n
SinEmits the sine of an angle
angle: Angle in radians (required)
sine: The sine of angle
CosEmits the cosine of an angle
angle: Angle in radians (required)
cosine: The cosine of angle
MinEmits the minimum of two numbers
n1: First number (required)
n2: Second number (required)
min: The minimum of n1 and n2
MaxEmits the maximum of two numbers
n1: First number (required)
n2: Second number (required)
max: The maximum of n1 and n2
Parse IntEmits the integer value of a string
str: String to parse (required)
int: The integer value of str
Parse FloatEmits the float value of a string
str: String to parse (required)
float: The float value of str
To FixedEmits 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 ThanEmits 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 EqualEmits 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 ThanEmits 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 EqualEmits 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 ListEmits the sum of a list of numbers
list: List of numbers (required)
sum: The sum of the numbers in list

Strings

IdDescriptionInputsOutputs
ConcatConcatenates two strings
a: String a (required)
b: String b (required)
value: Concatenated value
SplitSplits a string
string: String to split (required)
separator: Separator (required)
value: Splitted value
JoinJoins an array of strings
array: Array to join (required)
separator: Separator (required)
value: Joined value
ReplaceReplaces a string
string: String to replace (required)
searchValue: Value to search for (required)
replaceValue: Value to replace with (required)
value: Replaced value
TrimTrims a string
string: String to trim (required)
value: Trimmed value
To Lower CaseConverts a string to lower case
string: String to convert to lower case (required)
value: Converted value
To Upper CaseConverts a string to upper case
string: String to convert to upper case (required)
value: Converted value
SubstringReturns 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
LengthReturns the length of a string
string: String to get length from (required)
value: Length
Index OfReturns 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 OfReturns 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 AtReturns the character at the specified index
string: String to get character from (required)
index: Index to get character from (required)
value: Character
To Kebab CaseConverts a string to kebab case
string: String to convert to kebab case (required)
value: Converted value
To Camel CaseConverts a string to camel case
string: String to convert to camel case (required)
value: Converted value
To Pascal CaseConverts a string to pascal case
string: String to convert to pascal case (required)
value: Converted value
To Snake CaseConverts a string to snake case
string: String to convert to snake case (required)
value: Converted value
To Title CaseConverts a string to title case
string: String to convert to title case (required)
value: Converted value
IncludesDetermines 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 WithDetermines 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 WithDetermines 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 EmptyDetermines whether a string is empty
string: String to check (required)
value: Result
Match RegexDetermines whether a string matches a regular expression
string: String to check (required)
regex: Regular expression to match (required)
value: Result
Empty StringCreates an empty stringNone
string: The empty string

Control Flow

IdDescriptionInputsOutputs
Limit TimesItem 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
PublishPublishes 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
SubscribeSubscribes 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 SplitSplits 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 TriggerEmits 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

IdDescriptionInputsOutputs
List LengthReturns the length of a list
list: List (required)
length: Length
List Is EmptyReturns true if the list is empty
list: List (required)
isEmpty: Is empty
Get List ElementReturns the element at the specified index
list: List (required)
index: Index (required)
element: Element
RepeatRepeats a value a number of times
value: Value to repeat (required)
times: How many times will the value be repeated (required)
list: List
Concat ListsConcatenates two lists
list1: First list (required)
list2: Second list (required)
list: Concatenated list
ReverseReverses a list
list: List (required)
reversed: Reversed list
Loop ListEmits 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 restReceives 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 CountAccumulates 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
AppendAppends an item to a list
list: The list (required)
item: The item to append (required)
list: The resulting list
PrependPrepends an item to a list
list: The list (required)
item: The item to prepend (required)
list: The resulting list
Remove ItemRemoves an item from a list
list: The list (required)
item: The item to remove (required)
list: The resulting list
Remove Item AtRemoves 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
SliceReturns 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
FlattenFlattens a list of lists into a single list
list: The list of lists (required)
list: The resulting list

Console

IdDescriptionInputsOutputs
LogLogs a value to the console
value: Value to log (required)
None

Dates

IdDescriptionInputsOutputs
NowReturns the current date and timeNone
now: Current date and time
Now StringReturns the current date and time as a stringNone
now: Current date and time
Now ISO StringReturns the current date and time as a string in ISO formatNone
now: Current date and time
Now Unix TimeReturns the current date and time as a Unix timeNone
now: Current date and time
Date From Unix TimeCreates a date from a Unix time
time: Unix time (required)
date: Date
Date From StringCreates a date from a string
string: String (required)
date: Date
Date From ISO StringCreates a date from an ISO string
string: String (required)
date: Date
Date To StringConverts a date to a string
date: Date (required)
string: String
Date To ISO StringConverts a date to an ISO string
date: Date (required)
string: String
Date To Unix TimeConverts a date to a Unix time
date: Date (required)
time: Unix time
Date To YearConverts a date to a year
date: Date (required)
year: Year
Month To DateConverts a date to a month
date: Date (required)
month: Month
Date To DayConverts a date to a day
date: Date (required)
day: Day
Date To HoursConverts a date to hours
date: Date (required)
hours: Hours
Date To MinutesConverts a date to minutes
date: Date (required)
minutes: Minutes
Date To SecondsConverts a date to seconds
date: Date (required)
seconds: Seconds
Date To MillisecondsConverts a date to milliseconds
date: Date (required)
milliseconds: Milliseconds
Date To Day Of WeekConverts a date to a day of the week
date: Date (required)
day: Day
Date To Timezone OffsetConverts a date to a timezone offset
date: Date (required)
offset: Offset

State

IdDescriptionInputsOutputs
Set StateSets a value in the global state
key: Key to set (required)
value: Value to set (required)
setValue: Value that was set
Get StateGets 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

IdDescriptionInputsOutputs
ConnectConnects 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
FindQueries a Mongo database. Find receives a valid "mongodb" FindOptions object.
connection: Mongo connection (required)
collection: Collection (required)
query: Query (required)
options: Options (required)
result:
FindOneQueries a Mongo database. FindOne receives a valid "mongodb" FindOneOptions object.
connection: Mongo connection (required)
collection: Collection (required)
query: Query (required)
options: Options (required)
result:
DisconnectDisconnects from a Mongo database
connection: Mongo connection (required)
None
InsertOneInserts 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:
InsertManyInserts 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:
UpdateOneUpdates 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:
UpdateManyUpdates 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:
DeleteOneDeletes 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:
DeleteManyDeletes 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:
CountDocumentsCounts 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:
CreateIndexCreates 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:
CreateIndexesCreates 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

IdDescriptionInputsOutputs
Read FileReads a file from the file system
path: Path to the file (required)
encoding: Encoding of the file (optional)
contents: Contents of the file
Write FileWrites 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 FileAppends 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 FileDeletes a file from the file system
path: Path to the file (required)
None
ExistsChecks if a file exists
path: Path to the file (required)
exists: Whether the file exists

Postgres

IdDescriptionInputsOutputs
ConnectConnects 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
DisconnectDisconnects from a Postgres database
connection: Postgres connection (required)
None
QueryQueries a Postgres database. Query receives a valid "pg" QueryConfig object.
connection: Postgres connection (required)
query: Query (required)
result: valid "pg" QueryConfig object