0.0.2 • Published 8 years ago

koa-mustache v0.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

koa-mustache npm-version

NOTE: for koa@2.0.0 + only.

Feature

  • Visit /, /index will get resolved to /index.mustache
  • Visit /home will get resolved to /home.mustache or /home/index.mustache
  • If there is a .json or .data.js (which exports a object) file with same name beside the template file, it will be used as it's data source.

Usage

const Koa = require('koa')
const koaMustache = require('koa-mustache')

const app = new Koa()
app.use(koaMustache(__dirname + '/public', {
  extension: 'html'
}))

app.listen(3000)

Options

  • partialsDir(="_partials"): a directory inside public folder, for partial files.
  • extension(="mustache"): custom file extension to be recognized as mustache template.
  • debug(=false): enable debug log.

License

ISC © Amio

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago