bettiolo / oauth-signature-js

JavaScript OAuth 1.0a signature generator (RFC 5849) for node and the browser
https://www.npmjs.com/package/oauth-signature
BSD 3-Clause "New" or "Revised" License
232 stars 72 forks source link

Compiled dist/ file does not work in node #15

Closed StuAtGit closed 9 years ago

StuAtGit commented 9 years ago

The compiled version: dist/oauth-signature.js

Does not work in node, because it uses the window object, before any checks for the window object:

/*! url - v1.8.6 - 2013-11-22 */window.url=functi ....
;(function() {
    'use strict';

    // In node there is no global Window object
    var isNode = (typeof window === 'undefined');
StuAtGit commented 9 years ago

Nm. I didn't know what I was doing. Used bower for a bit, but just learning the npm packaging system.

bettiolo commented 9 years ago

Thank you, have you got any suggestions on how to improve the docs to make this easier to understand?

StuAtGit commented 9 years ago

I included the wrong header file. I guess an example like:

    <script language="javascript" type="text/javascript" src="bower_components/oauth-signature/dist/oauth-signature.js"></script>

Would have cleared it up for me. Thanks!

bettiolo commented 9 years ago

thank you!