Skip to main content

All Questions

-2 votes
1 answer
129 views

Lazy logging evaluation in JS? [closed]

Is there a way to do lazy evaluation when logging? For instance console.log("Result: ", throwingFunc()) won't log the first argument ("Result: "), as the 2nd argument, throwingFunc(...
Tar's user avatar
  • 9,075
0 votes
0 answers
165 views

Read a html file one line at a time in node.js

I'm converting a doc file into html using mammoth and then trying to read the html file line by line. As explained in this question, i've tried nodejs inbuilt readline module, but i'm getting the ...
Aman Kumar's user avatar
0 votes
1 answer
146 views

Is there any cool method to define/calc PI using lazy evaluation sequence?

I use lazy.js on javascript. I wonder if there's a cool method to define (not actually calc) PI empowered by lazy evaluation. I know lazy-evaluation is call-by-need, but how do you define PI in the ...
user avatar
0 votes
3 answers
165 views

underscore or lazy.js map (0,1,2,3,4) + (1,2,3,4,5) ->(1,3,5,7,9)

I want to map a sequence to another sequence such as map (0,1,2,3,4) + (1,2,3,4,5) -> (1,3,5,7,9) How to do that in lazy.js or underscore ? Thanks!
user avatar
0 votes
1 answer
716 views

lazy.js and xml stream parsing

I'm trying to parse through a kml file lazily with the xml stream module and running into a lack of relevant examples. Here's my code so far. var fs = require('fs'); var path = require('path'); var ...
ddombrow's user avatar
784 votes
31 answers
767k views

Read a file one line at a time in node.js?

I am trying to read a large file one line at a time. I found a question on Quora that dealt with the subject but I'm missing some connections to make the whole thing fit together. var Lazy=require("...
Alex C's user avatar
  • 17k