add totalFrames in node.js