Synchronous (Buffer) and asynchronous (Stream) encoding for node.js