Following the instructions listed in :help new-filetype-scripts,
create the scripts.vim file in the user runtime directory (~/.vim/
on Unix-like systems), and write the following script in it:
if did_filetype()
finish
endif
if getline(1) =~# '^#!.*/bin/env\s\+node\>'
setfiletype javascript
endif