Nbtemp is dumb and probably isn't what you're looking for. It's a template engine with no frills—it's just one small file and no dependencies. It either runs in your environment, or it doesn't.
What can it do? All the normal templating stuff: interpolate, flow control, includes, and blocks.
What it will never do? File IO, impose a stucture or a style on your project, be packaged for NPM, touch the DOM or use any JS feature restricted to a browser.
Don't use Nbtemp! It isn't what you're looking for. I made it to embed in an app I'm working on.
Create template functions using the Template constructor.
Render templates by calling the function with an argument object.
Nbtemp tags are where you tell the template compiler to stop copying and to start doing some processing. All tags start with <% and end with %>.
Nbtemp has several tags.
The environment is the universe of things that can be referenced from the current template. This includes the argument object. The contents of the argument object are accessed through the @ symbol.
If you want to dump the environment place <% env() %> somewhere in your template.
Given an argument object arg
and a template function t() called with the argument object t(arg)
Any conent outside of a block region will go in the designated content block.
MIT LICENSE Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.