This script produces the same output as Google's Marzipano Tool.
Google's Marzipano Tool can only be run within a browser on the client side & the tools soruce code in not publically available. This is a simple node.js script that produces the same output as Google's tool.
This scripts output can be read by the Marzipano viewer in your application.
Place your equirectangular image into the ./input/
dir.
Run script in terminal: node index.js