npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nodehp

v1.4.2

Published

Hypertext Preprocessor for NodeJS

Downloads

3

Readme

nodehp

A Hypertext Preprocessor for NodeJS, created in the spirit of PHP. However, instead of using PHP code, NodeJS with some added methods can be used instead.

Download nodehp

Install via npm:

npm install nodehp

Usage example

JS:

const nodehp = require('nodehp');

var data = {
	number: 10,
	string: "Hello World!"
}

//data is optional
var output_string = nodehp('path', data);

nodehp input:

<html lang="en">
    <head>
        <title>Test</title>
    </head>
    <body>

    	<!-- where your .nodehp code goes -->
        <nodehp>
        	var output = data.string + "for the " + data.number + "th time!";
            echo("<h1>" + output + "</h1>");
            echoTag('p', 'style="color: red;"','paragraph');
        </nodehp>

 </body>
</html>

Output:

<html lang="en">
    <head>
        <title>Test</title>
    </head>
    <body>

        <!-- where your .nodehp code goes -->
        <h1>Hello World! for the 10th time!</h1>
        <p style="color: red;">paragraph</p>
 </body>
</html>

API

Server Side

nodehp

Returns output HTML string from given .nodehp file.

require('nodehp')(_PATH_, data);

| Parameter | Type | Description | |-----------|--------|---------------------------------------------| | _PATH_ | String | String to print | | data | ANY | data to send to the external .nodehp file |

Client Side

nodehp Tag

This tag turns is what is special about a .nodehp file. It allows for NodeJS (with nodehp extentions) code to be written.

<nodehp>
    <!-- where your .nodehp code goes -->
</nodehp>

echo

Prints string to the HTML output string.

echo(_STR_);

| Parameter | Type | Description | |-----------|--------|------------------| | _STR_ | String | String to print |

tag

Returns a tag to the HTML output string. This string is not automatically added to the HTML output string.

tag(_TNAME_, _INL_, _STR_);

| Parameter | Type | Description | |-----------|--------|----------------------------------------------| | _TNAME_ | String | Tag Name | | _INL_ | String | inline tag options (like class or href) | | _STR_ | String | String to print |

echoTag

Combines echo() and tag().

echoTag(_TNAME_, _INL_, _STR_);

| Parameter | Type | Description | |-----------|--------|----------------------------------------------| | _TNAME_ | String | Tag Name | | _INL_ | String | inline tag options (like class or href) | | _STR_ | String | String to print |

include

Prints string to the HTML output string.

include(_IPATH_, _IDATA_);

| Parameter | Type | Description | |-----------|--------|---------------------------------------------| | _IPATH_ | String | path to external .nodehp file | | _IDATA_ | ANY | data to send to the external .nodehp file |

In your .nodehp code, the following cannot be used as they are necessary for nodehp to run properly:

For Internal Use:
  • _NODEHP_
  • _PATH_
  • _FILE_
  • _OUTPUT_
  • _CURSOR_
  • _STRING_
  • _STR_
  • _CSFKW_
  • _IPATH_
  • _IDATA_
  • _TNAME_
  • _INL_

For Sublime Users:

Included is my custom Sublime highlighting syntax (.sublime-syntax). This adds Javascript syntax highlighting inside the nodehp tag and uses the .nodehp file extention.

Installation:

In Sublime Text 3, got to: Prefrences > Browse Packages...

This will open a folder in file explorer. The .sublime-syntax file should go in the User folder.