Word count
FreeLogic@rabbinatix/word-count by Rabbinatixupdated Oct 4, 2026
Counts the words in a text, ignoring extra spaces.
Splits on spaces and drops the empty pieces that double spaces leave with Filter and a helper function that says whether to keep a piece.
Shows: Filter with a predicate function, Is Empty, NOT, Length.
How to use it
Add it to your logic, then add a Call Function step in any logic and pick Word count. It belongs to no system, so every system can use it. Or download the TypeScript and call it from your own code.
Inputs
text: Text
Outputs
words: Whole number
Previewdrag the steps around; scroll to zoom
Function Entry, Input / output. 0 inputs, 2 outputs. step 1 of 6
Word count
text
Trim, String. 1 input, 1 output. step 2 of 6
Trim
text
result
Split, String. 2 inputs, 1 output. step 3 of 6
Split
text
separator
parts
Filter, Collection. 1 input, 1 output. step 4 of 6
Filter Is a word
array
result
Length, Collection. 1 input, 1 output. step 5 of 6
Length
array
length
Return, Input / output. 2 inputs, 0 outputs. step 6 of 6
Return
words
Arrow keys: next or previous step in flow order. Alt with arrows: nearest step in that direction. Enter: open. Shift F10: more actions.
Examplesrun live against the logic · 2/2 pass
| Passed | Example | Input | Output |
|---|---|---|---|
| Double spaces | {"text":"the quick brown fox"} | {"words":4} | |
| Only spaces | {"text":" "} | {"words":0} |
Try it
Versions
In this package
Word count (entry)
Is a word
