
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
Compiles and stores handlebars templates and registers partials for faster view resolution.

Registers partials, compiles handlebars templates and shoves them into the oven so you can serve them hot later.
As an added convenience they are namespaced according to the 'templates' folder structure for easy access.
Assuming your handlebars templates folder looks as follows:
templates
├── index.hbs
└── partials
├── oven
│ ├── filter
│ │ ├── collector hbs
│ │ └── handle hbs
│ └── parts-index hbs
└── site
├── content hbs
└── header hbs
1. Heat your templates and pass continuation function:
hotplates.heat(
{ templates:
{ root: path.join(__dirname, 'templates')
, directoryFilter: '!partials'
}
, partials:
{ root: path.join(__dirname, 'templates', 'partials') }
}
, renderSite);
This compiles index.hbs, makes it accessible via handlebars.templates['index'] and
registers the following partials with handlebars:
'site.content'
'site.header'
'oven.parts-index'
'oven.filter.collector'
'oven.filter.handle'
They are now accessible under that name in other templates and partials.
2. In the continuation function start your server, etc. (in this example we'll open index page in the browser instead):
function renderSite(err) {
// Prepare a normal handlebars context
var ctx =
{ site:
{ title: 'Willie Slater\'s HotPlater'
, header:
{ title: 'Willie Slater makes your HotPlater'
, subtitle: 'Instructions on how to maintain your hotplates oven'
}
}
, oven:
{ filter:
{ handle: { how: 'very carefully' }
}
, top:
{ burners: { degrees: 250 }
, dials: { maxDegress: 500 }
}
}
};
// Render the index page using the context
var rendered = hotplates.oven.index(ctx);
fs.writeFileSync('./index.html', rendered);
exec('open ' + './index.html');
}
Full example here.
npm install hotplates
heat(opts, hot)
Heats your templates according to the given opts and calls back when they are hot.
At that point compiled templates are available in the oven and partials where registered with handlebars.
Typical opts:
{ templates:
{ root: path.join(__dirname, 'templates') // tell hotplates where your templates are
, directoryFilter: '!partials' // don't compile partials
}
, partials:
{ root: path.join(__dirname, 'templates', 'partials') } // register all my partials
, watch: true // autmatically re-compile and re-register my templates when I change them or add new ones
}
When set to true, hotplates will watch the templates and partial folders for changes and recompile templates, re-register partials when they change and add new ones that are created
Additional options can be given to templates and partials, most commonly you could change the fileFilter which defaults to ['*.hbs', '*.handlebars'].
Since hotplates resolves templates and partials using readdirp, refer to its options documentation.
handlebars.templates
After you heated your templates, they are registered as handlebars.templates namespaced according to the path they where found in.
E.g., a template found at 'site/reader/book.hbs' will be stored as a compiled Function under handlebars.templates['oven.site.reader.book'].
Partials are registered in a similar fashion as handlebars.partials.
Assuming the partial root was 'templates/partials', a partial found at 'templates/partials/book/page.hbs' will be accessible in other templates and partials under the name book.page.
Additionally you can access this partial directly via handlebars.partials['book.page'].
burn()
In order to remove all templates from handlebars and unregister all partials, you can burn them.
This is useful in cases where you want to make sure that no obsolete templates or partials are sticking around.
on('templateCompiled', function (fileInfo, name) { }) and on('partialRegistered', function (fileInfo, name) { })
fileInfo: supplied by readdirp and thus has the same structure as explained in the readdirp documentation. name: the full name under which the template was added to the oven or registered
These events are emitted when a template was [re]compiled or a partial [re]registered respectively.
This feature can be very useful for logging, etc.,
Example:
from examples/server.js
hotplates
.on('templateCompiled', function (fileInfo, name) {
console.log('Compiled: \t[ %s ] as [ %s ]', fileInfo.path, name);
})
.on('partialRegistered', function (fileInfo, name) {
console.log('Registered:\t[ %s ] as [ %s ]', fileInfo.path, name);
})
.heat({ ... }, serveSite );
Reading the tests will make you more familiar with hotplates' api.
FAQs
Compiles and stores handlebars templates and registers partials for faster view resolution.
We found that hotplates demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.