Hacker News new | past | comments | ask | show | jobs | submit login

Check out node-lazy, it does something similar and more nicely: https://github.com/pkrumins/node-lazy

    var Lazy = require('lazy');

    Lazy.range('1..') // infinite list of integers (see readme)
        .filter(function (n) {
            return n % 5 == 0
        })
        .take(5)
        .join(function (result) {
            console.log(result)
        })
    ;
Output:

    [ 5, 10, 15, 20, 25 ]



Hi pkrumins. Thanks for the feedback. I added a link to node-lazy in the 'Tribute' section of the stream.js tutorial. I like its syntax, and I'm sure many people would prefer it :)


Awesome!




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: