tafax / angular-digest-auth

AngularJS module to manage HTTP Digest Authentication
MIT License
28 stars 6 forks source link

Support npm installs #14

Open wu-lee opened 9 years ago

wu-lee commented 9 years ago

Using npm to install could be supported fairly trivially, and npm is sometimes preferable to using bower.

For example, the 0.4.3 tagged version of this module can be installed using npm using:

npm install 'git+https://git@github.com/tafax/angular-digest-auth.git#v0.4.3' --save

The main problem I can see here is that although the bower.json and README.md file lists dependencies on angular, angular-state-machine and angular-md5, the package.json file doesn't.

Consequentially, installing using npm like this doesn't get these required dependencies.

Adding support would be simple, the bower.json dependencies attribute can almost be used literally, except that angular-state-machine is not available on npm, so unless you publish that it must also be referenced via git:

"dependencies": {
  "angular-cookies": "*",
  "angular-md5": "*",
  "angular-state-machine": "git+https://git@github.com/tafax/angular-state-machine.git",
  "angular": "*"
},

Although of course, constraints to ensure obtaining a working version number as per the (docs)[https://docs.npmjs.com/files/package.json#dependencies] is good practice. Publishing this package to the npm manager allows other to do the same with this module.

Oh, I also notice that your bower.json states a dependency on angular-cookies, but your README.md does not.

Cheers!

tafax commented 9 years ago

Thank you for your suggestions. They sounds good. Feel free to send a pull request for that. It is very appreciated.