Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't put stuff on the window when module.exports is available #4

Open
feross opened this issue Apr 27, 2015 · 3 comments
Open

Don't put stuff on the window when module.exports is available #4

feross opened this issue Apr 27, 2015 · 3 comments

Comments

@feross
Copy link

feross commented Apr 27, 2015

Polluting the window object with the getStats method shouldn't be necessary when module.exports is available. Instead just export the function. This will help users who bundle their javascript with tools like browserify: http://browserify.org/, or people using webrtc in node.js via wrtc.

@kashifshamaz21
Copy link

+1. Also, adding support for AMD-loaders like RequireJS would be great.

@feross
Copy link
Author

feross commented May 8, 2015

Yeah. Have a look at https://github.com/umdjs/umd for snippets to use.

Or, just write your code in CommonJS (node.js) style and build with browserify -s getStats -r ./. This is how simple-peer does it, for instance: https://github.com/feross/simple-peer/blob/master/package.json#L62

muaz-khan added a commit that referenced this issue May 23, 2015
@sanbornhilland
Copy link

I'm wondering what happened to this issue? It looks like it was added but then removed. Was there a reason for that? Would you be open to pull requests for this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants