cfml

Parameters:
Name Type Required Default Hint
name string true The name of the CFML function to run

Command Usage

I am a shortcut to run single CFML functions via the REPL. This example runs the now() function.
It is the equivalent to "repl now()".

cfml now
As a handy shortcut, you can invoke the "cfml" command by simply typing the name of the CFML
function, preceded by a # sign.
#now
When you pass parameters into this command, they will be passed directly along to the CFML function.
#hash mypass

#reverse abc
This really gets useful when you start piping input into CFML functions. Like other CFML commands, piped
input will get passed as the first parameter to the function. This allows you to chain CFML functions
from the command line like so. (Outputs "OOF")
#listGetAt www.foo.com 2 . | #ucase | #reverse
Since this command defers to the REPL for execution, complex return values such as arrays or structs will be
serialized as JSON on output. As a convenience, if the first input to an array or struct function looks like
JSON, it will be passed directly as a literal instead of a string.

The first example averages an array. The second outputs an array of dependency names in your app by manipulating
the JSON object that comes back from the "package list" command.
#arrayAvg [1,2,3]

package list --JSON | #structFind dependencies | #structKeyArray
You must use positional parameters if you are piping data to a CFML function, but you do have the option to use
named parameters otherwise. Those names will be passed along directly to the CFML function, so use the CF docs to make sure
you're using the correct parameter name.
#directoryList path=D:\\ listInfo=name