Blog

Working with binary data in macchina.io JavaScript (and other improvements)

In the last couple of weeks new features have been added to the JavaScript environment in macchina.io. Most importantly, Buffer objects are now available in JavaScript, allowing to work efficiently with binary data. The HTTPRequest and uri objects have been extended to use Buffer objects in addition to strings. So now it’s also possible to work with binary content in HTTP requests.

Then there have been a few other improvements. For example setTimeout() and setInterval() support additional arguments that are passed to the callback function – as it is implemented in modern browsers. We now also have clearTimeout() and clearInterval(), as well as setImmediate() and clearImmediate() methods, which should make it easier to reuse existing JavaScript code in macchina.io.

And finally, logger and console have a new dump() method, which either prints out a JavaScript’s JSON representation in a pretty-printed indented format, or which hex dumps the contents of a Buffer.

Posted in macchina.io
Questions or comments? Contact us!