1.1.7 • Published 3 years ago

@sovietxd/nhp v1.1.7

Weekly downloads
-
License
GPL-2.0-only
Repository
github
Last release
3 years ago

Node.JS Hypertext Preprocessor

Package Version

What is it?

Node.JS Hypertext Preprocessor is a fast hypertext preprocessor 'aka PHP'.

Example of usage

const path = require('path');
const express = require('express');
const app = express();
const port = process.env.PORT || 3000
const NHP = require('@sovietxd/nhp');

var nhp = new NHP(); // Create NHP object
var nhpCtx = {       // Create NHP context object (these properties will be available under $ object in all .nhp scripts)
	"process": process,
	"app": app
}

nhp.setWebMap(nhp.genWebMap(path.join(__dirname, 'www'))); // Set main directory to ./www

app.use('/', nhp.bind(nhpCtx)); // Use NHP handler

app.listen(port, () => {})

License

NHP is licensed under GPL 2.0

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago