1.1.0 • Published 2 months ago

@hidoo/express-engine-handlebars v1.1.0

Weekly downloads
19
License
MIT
Repository
github
Last release
2 months ago

@hidoo/express-engine-handlebars

Handlebars template engine for express.

Installation

npm install --save express @hidoo/express-engine-handlebars

Usage

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 test

License

MIT

1.1.0

2 months ago

1.0.0

2 months ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago