Re: using streamlinejs with nodejs express framework

47 views
Skip to first unread message

Bruno Jouhier

unread,
May 10, 2013, 3:12:48 AM5/10/13
to stream...@googlegroups.com
I answered directly on stackoverflow. Code formatting is nicer there than on google groups.

Also, from the error, it looks like your streamline code was in a *.js file. It must be in a *._js file (see my response in stackoverflow)!

Bruno


2013/5/8 pranav paruchuri <pranav.p...@gmail.com>

I am new to the 'nodejs' world.So wanting to explore the various technologies,frameworks involved i am building a simple user posts system(users posting something everybody else seeing the posts) backed by redis.I am using express framework which is recommended by most tutorials.But i have some difficulty in gettting data from the redis server i need to do 3 queries from the redis server to display the posts.In which case have to use nested callback after each redis call.So i wanted to use streamline.js to simplify the callbacks.But i am unable to get it to work even after i used npm install streamline -g andrequire('streamline').register(); before calling

var keys=['comments','timestamp','id'];
var posts=[];
for(var key in keys){
    var post=client.sort("posts",'by','nosort',"get","POST:*->"+keys[key],_);
    posts.push(post);
}

i get the error ReferenceError: _ is not defined.

Please point me in the right direction or point to any resources i might have missed.

The code above is in a separate file that app.js and the  require('streamline').register(); is in that file itself.

This is a duplicate of a stack overflow question just thought i might get a better response here.

--
You received this message because you are subscribed to the Google Groups "streamline.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to streamlinejs...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages