MCPcopy
hub / github.com/expressjs/generator / loadTemplate

Function loadTemplate

bin/express-cli.js:427–441  ·  view source on GitHub ↗

* Load template file.

(name)

Source from the content-addressed store, hash-verified

425 */
426
427function loadTemplate (name) {
428 var contents = fs.readFileSync(path.join(__dirname, '..', 'templates', (name + '.ejs')), 'utf-8')
429 var locals = Object.create(null)
430
431 function render () {
432 return ejs.render(contents, locals, {
433 escape: util.inspect
434 })
435 }
436
437 return {
438 locals: locals,
439 render: render
440 }
441}
442
443/**
444 * Main program.

Callers 1

createApplicationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected