Skip to content

Instantly share code, notes, and snippets.

View belal-mazlom's full-sized avatar
😎
Having fun with Next.js, React and React native apps

Belal Al Mazlom belal-mazlom

😎
Having fun with Next.js, React and React native apps
View GitHub Profile
@benw
benw / load-hbs-partials.js
Created October 3, 2012 00:29
Loads partial handlebars templates from files in a directory
// Helps with this problem:
// http://stackoverflow.com/questions/8059914/express-js-hbs-module-register-partials-from-hbs-file
var hbs = require('hbs');
var fs = require('fs');
var partialsDir = __dirname + '/../views/partials';
var filenames = fs.readdirSync(partialsDir);