usablica / intro.js

Lightweight, user-friendly onboarding tour library
http://introjs.com
Other
22.8k stars 2.59k forks source link

Why does require('intro.js') export an object with just introJs? #581

Closed ibc closed 6 years ago

ibc commented 8 years ago
var introJs = require('intro.js');

console.log(introJs);

output:

Object { introJs: function(targetElm) }

This has little sense. Why doesn't require('intro.js') directly export the introJs function instead?

So, instead of exports.introJs = introJs; this would be much better to check for window.module and export module.exports = introJs.

odedniv commented 8 years ago

Oh wow I was trying to figure this out for an hour now... +1