:! node %, and that I can bind either of those to, eg,
,b. How can I set things up so that I can just bind a single command that will check the extension of the file I'm editing and run the appropriate command?
You could use
:make for this; you can set
makeprg (short for make program) to any command.
:make was originally intended to run the