nodejs module definition

Allow importing xterm into  a nodejs application (for instance an electron
application, or perhaps a test environment using phantomjs which
also has a DOM),
This commit is contained in:
Alexander Olsson
2016-04-11 15:08:47 +02:00
parent a88e27cc7d
commit 6a87253d94
+6 -1
View File
@@ -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
*/