What is NHP?

if (check()) {
    <h1>This is NHP!</h1>

Node Hypertext Preprocessor is a
template engine built on Node.js that employs the modular paradigm. It has no control-flow tags and among basic features, it has asynchronous rendering and allows you to utilize the entirety of the npm registry to render your markup!



Instead of using control-flow tags that can become annoying to deal with, NHP uses a simple whitespace-based approach to separate JavaScript from markup. Sandbox.


NHP templates share many features with Node.js modules. They have their own scope and can have input and output besides the markup they generate.


Thanks to JavaScript's async functions, NHP templates can easily render content that comes from external sources like a database or a web API.


Templates can include other templates and can require both local modules and external modules from npm. This gives you limitless flexibility!

By the way, the icons above are inline SVGs imported from the fontawesome-svg-core module. Putting them on this page was as simple as echo(icon('faCode'))

Check out the demos!

NHP is on Product Hunt right now!

Get started?

This is experimental technology and although it's not yet recommended for usage in production, this very website was built with it and it was a blast! You could check the source code here.

If you're feeling hyped, check the sandbox or go to GitHub where you can learn more!