stream-wormhole
stream-wormhole copied to clipboard
`TypeError: sendToWormhole is not a function` after upgrading to v2.0.1 using CommonJS require
This issue appears to be caused by a breaking change in the way the module is exported in v2.0.0. It seems that CommonJS require() no longer returns the function directly.
const sendToWormhole = require('stream-wormhole');
await sendToWormhole(stream);
// v1.1.0 ✅
// update to v2.0.1 ❌
// nodejs.TypeError: sendToWormhole is not a function
Should change to export style:
const { sendToWormhole } = require('stream-wormhole');
export default not work on commonjs.