updated npm example with new responses via onMessage