The docs show you how to precompile but it lacks the part where you save it to disk.
Here's a slightly modified example
// Load the YUI Template.Micro module.
var Micro = require('yui/template-micro').Template.Micro;
// Precompile a template string (pass any string you like here).
var precompiled = Micro.precompile(fs.readFileSync("./template.tmpl"));
// Save the compiled template to disk
fs.writeFileSync("./template.js", precompiled);
That last step is the important one.