[nodejs] how to structure this the best ?

2015-02-04 Thread Roelof Wobben
Hello, I like to make a ecommerce site in prefferluy koa.js. Now I wonder how I can structure this the best. make one big file of it. Make a api for customers, orders and product and make views that use the api. another approach Anyone who can give me some tips ? Roelof -- Job board: http

[nodejs] Re: list question

2015-02-03 Thread Roelof Wobben
if file.ext = ext then { > console.log(item[i] > } > }); > > Can you look at that "official answer" again? > > On Monday, February 2, 2015 at 2:00:42 PM UTC-6, Roelof Wobben wrote: >> >> Hello, >> >> I doing exercises of nodeschool. &g

[nodejs] list question

2015-02-02 Thread Roelof Wobben
Hello, I doing exercises of nodeschool. I have to filter some data in a list so I did ~~~ for (var i=0, i < list.length , i++ ) { if file.ext = ext then { console.log(print item[i] } } but in the official solution I see this : ~~~ List.foreach { if file.ext = ext

[nodejs] json parse output problem . SyntaxError: Unexpected token o

2015-01-21 Thread Roelof Wobben
Hello, I have this : ~~~ var user = { username: 'The Reddest', email: 'bran...@switchonthecode.com', firstName: 'Brandon', lastName: 'Cannaday' }; JSON.parse(user, function (k, v) { console.log(k); return v; }) ~~~ but when I do node test.js to ru

Re: [nodejs] have to filter out messages with a length shorter then 50

2015-01-20 Thread Roelof Wobben
Solved this one with a little try and error. Roelof Op dinsdag 20 januari 2015 19:37:41 UTC+1 schreef Roelof Wobben: > I already did . > > I have now this > > ~~~ > > module.exports = function getShortMessages(messages) { > > function smallerfifty(

[nodejs] book or beginners tutorial about functional programming in node

2015-01-20 Thread Roelof Wobben
Hello, I try to do the functional js workshop on nodeschool.io to learn more about this subject. But I noticed that I have to litle knowlegde to solve the problems. Is there a good book or tutorial so I can learn more about this subject. Roelof -- Job board: http://jobs.nodejs.org/ New gro

Re: [nodejs] have to filter out messages with a length shorter then 50

2015-01-20 Thread Roelof Wobben
esse labore magna elit irure.' , message: 'Amet esse excepteur mollit excepteur.' , ~~~ Op dinsdag 20 januari 2015 19:23:10 UTC+1 schreef Alexander Behrens: > Change return item.length < 50 to return item.message.length < 50 > > On Tue, Jan 20, 2015 at 5:52 PM, Roelo

Re: [nodejs] have to filter out messages with a length shorter then 50

2015-01-20 Thread Roelof Wobben
rien Risser > > wrote: >> >> Filter is what you're looking for. >> >> >> https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/filter >> >> On Tue, Jan 20, 2015 at 5:06 PM, Roelof Wobben > > wrote: >> >

Re: [nodejs] have to filter out messages with a length shorter then 50

2015-01-20 Thread Roelof Wobben
uari 2015 17:48:21 UTC+1 schreef Alexander Behrens: > Also, you can pass the function as an argument directly: > > return messages.filter(small_message); > > On Tue, Jan 20, 2015 at 5:27 PM, Adrien Risser > wrote: > >> Filter is what you're looking for. >> >> >> h

Re: [nodejs] have to filter out messages with a length shorter then 50

2015-01-20 Thread Roelof Wobben
n argument directly: > > return messages.filter(small_message); > > On Tue, Jan 20, 2015 at 5:27 PM, Adrien Risser > wrote: > >> Filter is what you're looking for. >> >> >> https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array

Re: [nodejs] have to filter out messages with a length shorter then 50

2015-01-20 Thread Roelof Wobben
ld expect > to see this: > > return messages.map( … > > Best, > Scott > > > On Jan 20, 2015, at 8:06 AM, Roelof Wobben > wrote: > > Hello, > > I try to learn functional javascript by following the functonial workshop > of nodeschool. > > Now I

Re: [nodejs] have to filter out messages with a length shorter then 50

2015-01-20 Thread Roelof Wobben
dag 20 januari 2015 17:30:56 UTC+1 schreef Adrien Risser: > Filter is what you're looking for. > > > https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/filter > > On Tue, Jan 20, 2015 at 5:06 PM, Roelof Wobben > wrote: > >> H

[nodejs] have to filter out messages with a length shorter then 50

2015-01-20 Thread Roelof Wobben
Hello, I try to learn functional javascript by following the functonial workshop of nodeschool. Now I have to filter out all the messages which lenght are shorter then 50. So I thought this would work : ~~~ module.exports = function getShortMessages(messages) { function small_message

Re: [nodejs] Through : how to output things

2015-01-20 Thread Roelof Wobben
Op dinsdag 20 januari 2015 04:50:05 UTC+1 schreef ryandesign: > > > On Jan 19, 2015, at 12:25 PM, Roelof Wobben wrote: > > > > I try to solve a nodeschool exercise where a json file is the input. > > > > So far I have this : > > > > ~~~ &g

[nodejs] Through : how to output things

2015-01-19 Thread Roelof Wobben
Hello, I try to solve a nodeschool exercise where a json file is the input. So far I have this : ~~~ var combine = require('stream-combiner'); var through = require('through'); module.exports = function() { var group = through (write,end) function write(line) {

Re: [nodejs] throught2 : what did I do wrong

2015-01-18 Thread Roelof Wobben
Thanks, another point learned. Roelof Op zondag 18 januari 2015 16:17:39 UTC+1 schreef Aria Stewart: > > > On 18 Jan 2015, at 04:53, Roelof Wobben > wrote: > > > > Hello, > > > > I try to make a function which uppercase a stream by usi

[nodejs] Re: Can this be done by the transform class and how does it look like

2015-01-18 Thread Roelof Wobben
Op zaterdag 17 januari 2015 19:19:13 UTC+1 schreef Luca Morandini: > > On 17/01/15 03:21, Roelof Wobben wrote: > > > > Does anyone have a tip if this can be done and how I can do this ? > > var fs= require("fs"); > var stream= require("stream"

[nodejs] throught2 : what did I do wrong

2015-01-18 Thread Roelof Wobben
Hello, I try to make a function which uppercase a stream by using through2. So I did this : ~~~ var through = require('through2'); var tr = through(function (chunk, enc,callback) { chunk. toString().toUpperCase(); this.push(chunk); callback(); }); process.stdin.pipe(tr).pipe(

[nodejs] Can this be done by the transform class and how does it look like

2015-01-16 Thread Roelof Wobben
Hello, As a solution I made this : ~~~ var through = require('through'); var tr = through(function write(data) { this.queue(data.toString().toUpperCase()) }, function end () { this.queue(null) }); process.stdin.pipe(tr).pipe(process.stdout); ~~~ Now I have read th

Re: [nodejs] what is wrong here ?

2015-01-12 Thread Roelof Wobben
ements saying what values you’re going to pass to each of the library > calls you make? > > (You should use path.resolve or path.join instead of filename = __dirname > + argv[3] — __dirname doesn’t come with a trailing slash, among other > things.) > > F > ​ > > On

[nodejs] what is wrong here ?

2015-01-11 Thread Roelof Wobben
I try to make a exercise of nodeschool.io but I cannot make it work. I have this : var http = require ('http'); var fs = require('fs') http.createServer(function(req, res) { var filename = __dirname+ process.argv[3] var readStream = fs.createReadStream(filename); readStream.on('open'

Re: [nodejs] Is this good use of javascript or can I better use variables

2014-12-28 Thread Roelof Wobben
Oke, Case can be closed. Roelof Op zondag 28 december 2014 05:21:03 UTC+1 schreef ryandesign: > > > On Dec 27, 2014, at 1:34 PM, Roelof Wobben wrote: > > > > Oke > > > > Let's say it a one and one logging purpose. > > I don't un

[nodejs] good tutorial about for example a reservation system

2014-12-28 Thread Roelof Wobben
Hello, Does anyone know a good tutorial where there is a relation between models like a reservation or commenting system ? Prefferly in Express Roelof -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules:

Re: [nodejs] Is this good use of javascript or can I better use variables

2014-12-27 Thread Roelof Wobben
or if this is a one and done for logging purposes. > > Sent from my iPhone > > On Dec 27, 2014, at 1:39 PM, Roelof Wobben > wrote: > > Hello, > > I do the nodeschool.io course and on the javascripting part I have to put > the length of a string to the screen. &

[nodejs] Is this good use of javascript or can I better use variables

2014-12-27 Thread Roelof Wobben
Hello, I do the nodeschool.io course and on the javascripting part I have to put the length of a string to the screen. So I did this : /** * Created with Ecomm - node. * User: roelof1967 * Date: 2014-12-27 * Time: 06:34 PM * To change this template use Tools | Templates. */ var example = "exa

Re: [nodejs] which framework to use (express, meteor or koa)

2014-12-21 Thread Roelof Wobben
Op zondag 21 december 2014 03:54:48 UTC+1 schreef Aria Stewart: > > > > On 20 Dec 2014, at 13:39, Roelof Wobben > wrote: > > > > > > > > Op zaterdag 20 december 2014 19:28:12 UTC+1 schreef Aria Stewart: > > On Dec 20, 2014 10:27

Re: [nodejs] which framework to use (express, meteor or koa)

2014-12-20 Thread Roelof Wobben
Op zaterdag 20 december 2014 19:28:12 UTC+1 schreef Aria Stewart: > > On Dec 20, 2014 10:27 AM, Roelof Wobben > > wrote: > > > > Hello, > > > > I want to try to make a financial app in node,js by using a web > frameworks. > > > > As far

[nodejs] which framework to use (express, meteor or koa)

2014-12-20 Thread Roelof Wobben
Hello, I want to try to make a financial app in node,js by using a web frameworks. As far as I can see there are a few I can use like meteor, express or koa. Which one can I use the best and why ? Roelof -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23

[nodejs] what is the best path for a really beginner

2014-12-17 Thread Roelof Wobben
Hello, Im a beginner in javascript and node.js. I have some knowlegde about ruby and rails. I have tried to learn node.js by using the lessons of nodeschoo.io but the exercises were something too difficult and too abstract Now I wonder what is the best path to learn node.js with as ultimate

[nodejs] website tutorials

2014-12-15 Thread Roelof Wobben
Hello, I now learning node.js by following the tutorials on nodeschool. But I wonder if there were tutorials about making a complete website / app with one of the node.js frameworks, At the end I want to make a sort of ecommerce site for a toy library. Roelof -- Job board: http://jobs.nodej