Make all add-ons CommonJS importable

- Fix #52
- Rename `npm/nodejs project` documentation to `CommonJS environment`
This commit is contained in:
Paris
2016-05-03 12:05:13 +03:00
parent 537fbad705
commit bd2158613d
5 changed files with 27 additions and 7 deletions
+6 -1
View File
@@ -7,7 +7,12 @@
*/
(function (attach) {
if (typeof define == 'function') {
if (typeof exports === 'object' && typeof module === 'object') {
/*
* CommonJS environment
*/
module.exports = attach.call(this);
} else if (typeof define == 'function') {
/*
* Require.js is available
*/