diff --git a/moo.js b/moo.js index df8d799..82dc095 100644 --- a/moo.js +++ b/moo.js @@ -273,7 +273,7 @@ this.reset() } - if (typeof require !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { var Transform = require('stream').Transform Lexer.prototype.stream = function(state) {