Yes it's called existsSync(). You don't need some fancy function to call the event loop if you just want to find a file before the rest of your code starts.
On Wed, Jan 21, 2015 at 6:06 PM, Fredrik O <[email protected]> wrote: > I need to call a function synchronously which trigger the event loop to be > processed before the function returns. Pseudo code: > > > require('fs').exists('file', function() { > // This function should be fired even for the while-loop below > }); > > while(true) { > runEventLoop(); // process the eventloop, so all asynchronous tasks > will be run anyway > } > > > Is there any inbuilt function for that? > > > Thanks in advance! > > -- > Job board: http://jobs.nodejs.org/ > New group rules: > https://gist.github.com/othiym23/9886289#file-moderation-policy-md > Old group rules: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/nodejs/08f6b047-e4d1-40ef-97f6-b5b91d82e198%40googlegroups.com > <https://groups.google.com/d/msgid/nodejs/08f6b047-e4d1-40ef-97f6-b5b91d82e198%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAPJ5V2Z%2B07L_81Kk%2BqfKKj_hVpXC8PPh%2BwACzV91%3DJey%2BY%2BFbg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
