1.2.0 • Published 7 months ago
@hidoo/express-engine-handlebars v1.2.0
@hidoo/express-engine-handlebars
Handlebars template engine for express.
Installation
npm install --save express @hidoo/express-engine-handlebarsUsage
import express from 'express';
import expressEngineHandlebars from '@hidoo/express-engine-handlebars';
const app = express();
app.set('view engine', 'hbs');
app.set('views', '/path/to/views');
app.engine(
'hbs',
expressEngineHandlebars({
layouts: '/path/to/views/layouts/**/*.hbs',
partials: '/path/to/views/partials/**/*.hbs',
helpers: '/path/to/views/helpers/**/*.js'
})
);Registering Helpers
example:
export const register = (handlebars) => {
handlebars.registerHelper(
'wrapBrackets',
(value) => new handlebars.SafeString(`[[ ${value} ]]`)
);
};Test
pnpm testLicense
MIT
1.2.0
7 months ago
1.1.0
2 years ago
1.0.0
2 years ago
0.8.2
4 years ago
0.8.1
5 years ago
0.8.0
6 years ago
0.7.0
6 years ago
0.6.1
6 years ago
0.6.0
6 years ago
0.1.9
6 years ago
0.1.8
7 years ago
0.1.7
7 years ago
0.1.6
7 years ago
0.1.5
7 years ago
0.1.4
7 years ago
0.1.3
7 years ago
0.1.2
7 years ago
0.1.1
7 years ago
0.1.0
7 years ago