diff --git a/src/xterm.js b/src/xterm.js index 42c8b81c28..5642bfe787 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -32,7 +32,12 @@ */ (function (xterm) { - if (typeof define == 'function') { + if (typeof exports === 'object' && typeof module === 'object') { + /* + * npm/nodejs project + */ + module.exports = xterm.call(this); + } else if (typeof define == 'function') { /* * Require.js is available */