1.0.0 • Published 6 years ago

reshape-express v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Reshape Express

npm tests dependencies coverage

An express view engine for reshape

Note: This project is in early development, and versioning is a little different. Read this for more details.

Installation

npm install reshape-express -S

Note: This project is compatible with node v6+ only

Usage

Require it and run the exported function, passing it your express app and your reshape options, plugins, etc. It will match .html files by default, you can pass an alternate file type as the third argument if you want.

Then set up your views directory and view engine, and pass in any locals when you run res.render. That's it! Example below:

const express = require('express')
const reshape = require('reshape-express')
const standard = require('reshape-standard')

const app = express()
reshape(app, standard(), 'sgr')

app.set('views', './views')
app.set('view engine', 'sgr')

app.get('/', (req, res) => {
  res.render('index.sgr', { foo: 'bar' })
})

app.listen(3000)

And in views/index.sgr:

h1 Test Page!
p {{ foo }}

Should come out rendered correctly with locals and all. Whoo! 🎉

License & Contributing

1.0.0

6 years ago

0.1.1

7 years ago

0.1.0

7 years ago