<commit_before>==nTPL project: simple, fast and powerfull templates for node.js (http://github.com/donnerjack13589/nTPL).
It's easy to learn - start now!
Now comes with support of *Express.js*!

==It's fast:
Mustache saids that running complex.html example gives following results:
	Mu -  40 secs  (benchmarks/million_complex.js)

On my PC - running nTPL's:
	nTPL - 2 secs (benchmarks/million_complex.js)

Feel the difference?

==Some features:
* nTPL have native parser written on C++, so templates are compiled very fast.
* nTPL have many optimizations in template rendering process.
* nTPL uses buffers
* nTPL is extendable (nTPL.modificators)
* nTPL can reload template on file change (watch: true)

==Installation:
	npm install nTPL

==Manual installation instructions:
	curl http://github.com/donnerjack13589/nTPL/raw/master/install.sh | sh
or if it dies "Permission Denied" or EACCESS error
	curl http://github.com/donnerjack13589/nTPL/raw/master/install.sh | sudo sh
	
==Advanced installation instructions:	
	git clone git@github.com:donnerjack13589/nTPL.git
	cd nTPL
	make
	make install
	make test

==Basic examples:
	
	nTPL("1 + 1 = {%= 1+1 %}")();
	nTPL({
		template : "1 + 1 = {%= 1+1 %}"
	})();
	nTPL("filename.tpl")();
	// 1 + 1 = 2
	
	nTPL({
		template : "Hello {%= a %}!",
		args: ["a"]
	})({a: 'World'});
	// >> Hello World!
	
	nTPL({
		template: "Hello {%each a%}{%= this %}, {%/each%}world!",
		args: ["a"]
	})({a: ['Andy','Alex']});
	// >>  Hello Andy, Alex, World!
	
	nTPL({
		template: "{%if godmode%}My Lord!{%else%}Who are you?{%/if%}",
		args: ["godmode"]
	})({godmode: true});
	// >> My Lord!
	
	var $ = require("nTPL");
	$.parse("It also works!")();
	// >> It also works!
	
==Medium examples:
	
	nTPL("foo {* text here won't be compiled or printed *} bar")();
	// >> foo  bar
	
	nTPL("{%each [1,2,3] %} "{%= this %}" {%/each%}?")();
	// >> "1" "2" "3" 
	
	nTPL("{%catch var a %}What's up, dude?{%/catch%}{%= a.substr(0,9) %}?")();
	// >> What's up?
	
	nTPL({
		template: "filename.tpl",
		callback: function (tpl) {
			console.log(tpl());
		}
	});
	// Will load "filename.tpl" in async mode
	
==Harder examples:
		
	nTPL({
		template: "<button>{%= value%}</button>",
		args: ["value"],
		name: "input"
	});
	nTPL("input")({value:'Hello world!'});
	// >> Button with text "Hello world!"
	
	nTPL({
		template: "filename.tpl",
		callback: function (tpl) {
			console.log(tpl());
		},
		watch: true
	});
	// Will load "filename.tpl" in async mode
	// And watch for file changes (template will be refreshed)
	// P.S. Also available in a sync mode
		
==Block module

	require("nTPL.block");
	
	nTPL({
		template: "Hello, {%block 'username'%}{%/block%}!{%= message %}",
		args: ["message"],
		name: "block-test"
	});
	nTPL("{%extends 'block-test', {message: "How do you do?"}%}{%block 'username'%}Admin{%/block%}")();
	// >> Hello, Admin!How do you do?

==Set modificators
	
Use "set" modificator to setup options inside template

===Examples:
"set.html"
	{%set name first template %}
	{%set args a1, a2, a3 %}
	{%set some 123 %}
	{%set foo.bar 1,2,3 %}
	{%= a1 %}
	{%= a2 %}
	{%= a3 %}

Template generated from this file will have 'first template' name and can get 'a1', 'a2', 'a3' as arguments

	var tpl = nTPL("set.html");
	nTPL("first template")({a1:1,a2:2,a3:3});
	tpl.options; // {name: "first template", args: ["a1", "a2", "a3"], some: "123", foo : { bar: ["1","2","3"] } }

===More info:
You can't setup any other options now. Only 'name' and 'args' are allowed.
But if you generated template with "watch=true" and then change {%set ... %} in template - 'name' and 'args' will be refreshed!<commit_msg>Express.js in readme must be bold!<commit_after>==nTPL project: simple, fast and powerfull templates for node.js (http://github.com/donnerjack13589/nTPL).
It's easy to learn - start now!
Now comes with support of <b>Express.js</b>!

==It's fast:
Mustache saids that running complex.html example gives following results:
	Mu -  40 secs  (benchmarks/million_complex.js)

On my PC - running nTPL's:
	nTPL - 2 secs (benchmarks/million_complex.js)

Feel the difference?

==Some features:
* nTPL have native parser written on C++, so templates are compiled very fast.
* nTPL have many optimizations in template rendering process.
* nTPL uses buffers
* nTPL is extendable (nTPL.modificators)
* nTPL can reload template on file change (watch: true)

==Installation:
	npm install nTPL

==Manual installation instructions:
	curl http://github.com/donnerjack13589/nTPL/raw/master/install.sh | sh
or if it dies "Permission Denied" or EACCESS error
	curl http://github.com/donnerjack13589/nTPL/raw/master/install.sh | sudo sh
	
==Advanced installation instructions:	
	git clone <EMAIL>:donnerjack13589/nTPL.git
	cd nTPL
	make
	make install
	make test

==Basic examples:
	
	nTPL("1 + 1 = {%= 1+1 %}")();
	nTPL({
		template : "1 + 1 = {%= 1+1 %}"
	})();
	nTPL("filename.tpl")();
	// 1 + 1 = 2
	
	nTPL({
		template : "Hello {%= a %}!",
		args: ["a"]
	})({a: 'World'});
	// >> Hello World!
	
	nTPL({
		template: "Hello {%each a%}{%= this %}, {%/each%}world!",
		args: ["a"]
	})({a: ['Andy','Alex']});
	// >>  Hello Andy, Alex, World!
	
	nTPL({
		template: "{%if godmode%}My Lord!{%else%}Who are you?{%/if%}",
		args: ["godmode"]
	})({godmode: true});
	// >> My Lord!
	
	var $ = require("nTPL");
	$.parse("It also works!")();
	// >> It also works!
	
==Medium examples:
	
	nTPL("foo {* text here won't be compiled or printed *} bar")();
	// >> foo  bar
	
	nTPL("{%each [1,2,3] %} "{%= this %}" {%/each%}?")();
	// >> "1" "2" "3" 
	
	nTPL("{%catch var a %}What's up, dude?{%/catch%}{%= a.substr(0,9) %}?")();
	// >> What's up?
	
	nTPL({
		template: "filename.tpl",
		callback: function (tpl) {
			console.log(tpl());
		}
	});
	// Will load "filename.tpl" in async mode
	
==Harder examples:
		
	nTPL({
		template: "<button>{%= value%}</button>",
		args: ["value"],
		name: "input"
	});
	nTPL("input")({value:'Hello world!'});
	// >> Button with text "Hello world!"
	
	nTPL({
		template: "filename.tpl",
		callback: function (tpl) {
			console.log(tpl());
		},
		watch: true
	});
	// Will load "filename.tpl" in async mode
	// And watch for file changes (template will be refreshed)
	// P.S. Also available in a sync mode
		
==Block module

	require("nTPL.block");
	
	nTPL({
		template: "Hello, {%block 'username'%}{%/block%}!{%= message %}",
		args: ["message"],
		name: "block-test"
	});
	nTPL("{%extends 'block-test', {message: "How do you do?"}%}{%block 'username'%}Admin{%/block%}")();
	// >> Hello, Admin!How do you do?

==Set modificators
	
Use "set" modificator to setup options inside template

===Examples:
"set.html"
	{%set name first template %}
	{%set args a1, a2, a3 %}
	{%set some 123 %}
	{%set foo.bar 1,2,3 %}
	{%= a1 %}
	{%= a2 %}
	{%= a3 %}

Template generated from this file will have 'first template' name and can get 'a1', 'a2', 'a3' as arguments

	var tpl = nTPL("set.html");
	nTPL("first template")({a1:1,a2:2,a3:3});
	tpl.options; // {name: "first template", args: ["a1", "a2", "a3"], some: "123", foo : { bar: ["1","2","3"] } }

===More info:
You can't setup any other options now. Only 'name' and 'args' are allowed.
But if you generated template with "watch=true" and then change {%set ... %} in template - 'name' and 'args' will be refreshed!
{'fraction_non_alphanumeric': 0.1924857785421352, 'fraction_numerical': 0.019050138907262867, 'mean_word_length': 3.2400448681996634, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2672397', 'n_tokens_mistral': 3122, 'n_tokens_neox': 2763, 'n_words': 804}