Functionally equivalent to process substitution is the use of a named pipe (and depending on what the underlying system supports, is how bash
implements process substitution).
# Create a named pipe - it's like a file, but of limited size
# A process that writes to it will block until another process reads some
# data and frees up some space for more output
mkfifo node_js_output
# Run node in the background, redirecting its output to the pipe
node bar.js > node_js_output
# Concatenate foo.txt and the output from node to out.txt
cat foo.txt node_js_output > out.txt
# When node bar.js completes, it will exit. Once cat has finished
# reading everything written to node_js_output, it will exit as well,
# leaving behind the "empty" node_js_output. You can delete it now
rm node_js_output