untitled notebook

node v8.17.0
version: master
endpointsharetweet
var templateWriter = require("template-writer") var templateOptions = { templateDir:'./templates', targetDir:'/tmp' } var config = { name: 'index.html', target:'index.html', vars: { title: 'My Page', content: 'My Content' } } templateWriter( config, templateOptions ); //check file creation var fs = require('fs'); setTimeout(function(){ fs.readFile('/tmp/index.html',function(err,data){ console.log("Check title"); console.log(data.toString().indexOf(config.vars.title)>0); console.log("Check content"); console.log(data.toString().indexOf(config.vars.content)>0); }); },2000)
Loading…

no comments

    sign in to comment