mozilla/fxa-js-client — pull request #84 by glenjamin (2014-02-22 12:37:24+00:00)
Title: Allow client to be used as an npm module

As mentioned in #80 and dicussed a bit on IRC, a review of the approach taken would be appreciated. the amd-loader.js bit is a little bit wacky, but seems to work reasonably well.

* No longer runs bower on npm install
* Added "setup" task for development seutp
* Added basic AMD shim
* Exposed FxAccountClient via AMD shim as node-style module
* Declared runtime dependencies in package.json
* Explicitly specified "files" for small npm upload/download
* Added intern:native_node which runs tests on the node client

I tried this out against a local npm registry, here's what this enables:
```
> npm publish --registry http://localhost:5984
npm http PUT http://localhost:5984/fxa-js-client
npm http 200 http://localhost:5984/fxa-js-client
+ fxa-js-client@0.1.11
```
```
> tar tf fxa-js-client-0.1.11.tgz
package/package.json
package/README.md
package/LICENSE
package/client/FxAccountClient.js
package/client/.jshintrc
package/client/lib/credentials.js
package/client/lib/errors.js
package/client/lib/hawk.js
package/client/lib/hawkCredentials.js
package/client/lib/hkdf.js
package/client/lib/pbkdf2.js
package/client/lib/request.js
package/client/node/amd-loader.js
package/client/node/index.js
```
```
> npm install fxa-js-client --registry http://localhost:5984
npm http GET http://localhost:5984/fxa-js-client
npm http 200 http://localhost:5984/fxa-js-client
npm http GET http://localhost:5984/p-promise
npm http GET http://localhost:5984/sjcl-full
npm http 304 http://localhost:5984/p-promise
npm http 304 http://localhost:5984/sjcl-full
fxa-js-client@0.1.11 node_modules/fxa-js-client
├── xmlhttprequest@1.5.1
├── p-promise@0.2.5
└── sjcl-full@1.0.0
```
```javascript
var client = require('fxa-js-client')('https://api-accounts.dev.lcip.org/v1');

client.signUp('glenjamin@email.com', 'apassword').done(console.log, console.error)
```