I tried that. The last two lines went into 'main.tpl'
The first 11 or so lines went into 'routines.tpl'
both files were in the ~/CNC/camotics directory.
I loaded 'main.tpl' into camotics, and it couldn't find 'routines.tpl'
I tried renaming 'routines.tpl' to routines.json'
and changed the line to:
var routines = require('routines.json');
but that didn't work.
I get the impression that javascript is very very sensitive to syntax.