Skip to content

Commit

Permalink
nodejs module definition
Browse files Browse the repository at this point in the history
Allow importing xterm into  a nodejs application (for instance an electron
application, or perhaps a test environment using phantomjs which
also has a DOM),
  • Loading branch information
noseglid committed Apr 11, 2016
1 parent a88e27c commit 6a87253
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/xterm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 6a87253

Please sign in to comment.