akaspin / nun Goto Github PK
View Code? Open in Web Editor NEWTotally asynchronous non-blocking template engine for node.js
License: MIT License
Totally asynchronous non-blocking template engine for node.js
License: MIT License
I totally love nun, thanks for this module!
Is it possible to make a npm package out of it so I can set it as a dependency for my own programs?
make
-n test/test-basic.js:
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Not a string or buffer
at Array.<anonymous> (/usr/local/lib/node_modules/nun/index.js:35:25)
at EventEmitter._tickCallback (node.js:126:26)
FAIL
Related to this bit of code:
if (have_openssl) {
// if have openssl, add options hash to key
key += crypto.createHash("sha1").
update(options).digest("hex");
}
I think options is an object, and the update function on on the crypto is looking for a string or buffer.
TypeError: Not a string or buffer
at Array. (node_modules/nun/index.js:35:25)
at EventEmitter._tickCallback (node.js:126:26)
When running the examples. Have to give a random string instead of option object to bypass.
Is it possible to add nested block feature?
Thank you very much!
Every test and even the example on the readme throw the same error all the time (using node.js version: v0.1.96-8-g3768aaa) (using 'make' all tests fail with this error) :
pubuntu@pubuntu:/media/cofs2/nodedev$ node testing.js
crypto:3638
return (new Hash).init(hash);
^
TypeError: undefined is not a function
at CALL_NON_FUNCTION_AS_CONSTRUCTOR (native)
at Object.createHash (crypto:3638:11)
at /media/cofs2/nodedev/nun/index.js:35:19
at EventEmitter._tickCallback (node.js:48:25)
at node.js:204:9
testing.js is:
var sys = require("sys");
var nun = require("./nun");
var origin = "template.html";
nun.render(origin, { name: "John Dow" }, {}, function(err, output){
if (err) throw err;
var buffer = '';
output.addListener('data', function(data){ buffer += data; })
.addListener('end', function(){ sys.puts(buffer) });
});
template.html:
Name is {{name}}.
subj
undefined:3
var HS = new HStream();
^
ReferenceError: HStream is not defined
at eval at compile (/path/to/nun/lib/nun/compiler.js:58:2)
at /path/to/nun/lib/nun/index.js:73:23
at /path/to/nun/lib/nun/index.js:40:6
at Object.get (/path/to/nun/lib/nun/cache.js:43:15)
at /path/to/nun/lib/nun/index.js:38:10
at EventEmitter._tickCallback (node.js:48:25)
at node.js:221:9
I think nun is really a good idea templating engine
But how can I do multi-level override?
testOverride.html
{{< testBase.html}}
{{+ content}}
I Am Content
{{/ content}}
testBase.html
{{< testSuperBase.html}}
{{+ contentWrap}}
testSuperBase.html
{{+ contentWrap}} {{/ contentWrap}}When I render testOverride.html, it give me :
the content is missing... please help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.