How to convert Blob to File in JavaScript

I need to upload an image to NodeJS server to some directory. I am using connect-busboy node module for that. I had the dataURL of the image that I converted to blob using the following code: dataURLToBlob: function(dataURL) { var BASE64_MARKER = ‘;base64,’; if (dataURL.indexOf(BASE64_MARKER) == -1) { var parts = dataURL.split(‘,’); var contentType = … Read more

Is there a compatibility list for Angular / Angular-CLI and Node.js?

I periodically run into the problem, having to spin up old Angular projects with deprecated dependencies of Angular. Because I unsually run the latest Node.js version (at least lates LTS version) I often had the problem, that I wasn’t able to get the old projects running. I solved this by using a node version manager, … Read more

Unexpected results when working with very big integers on interpreted languages

I am trying to get the sum of 1 + 2 + … + 1000000000, but I’m getting funny results in PHP and Node.js. PHP $sum = 0; for($i = 0; $i <= 1000000000 ; $i++) { $sum += $i; } printf(“%s”, number_format($sum, 0, “”, “”)); // 500000000067108992 Node.js var sum = 0; for (i … Read more

Socket.IO – how do I get a list of connected sockets/clients?

I’m trying to get a list of all the sockets/clients that are currently connected. io.sockets does not return an array, unfortunately. I know I could keep my own list using an array, but don’t think this is an optimal solution for 2 reasons: Redundancy. Socket.IO already keeps a copy of this list. Socket.IO provides method … Read more