Rabrennie/anything.js

Can I use a third-party package?

Closed this issue · 5 comments

I'd love to include some date-related functions but don't want to duplicate the code as I already have them created and tested here: https://github.com/montanaflynn/human-date

Would it be ok to include my package in the package.json file?

humandate.js is probably small enough that it could fit inside Δ.js, Rabrennie would have the final say though

As long as you check to see if it's loaded in some way I don't see why not. I'd rather you put it as a bower dependency for now because I'm only really using npm for gulp. As @toish said though it would fit in Δ.js but as I said it's really up to you.

I added human-date to bower, can you give me an example of how to include it?

Add something like this to bower.json

  (...),
  "dependencies": {
        "the-name-of-your-package": "~1.2.3"
  }
}

where 1.2.3 is your desired version.
I'm not sure on how you should go about actually including it. I'd say that you should probably put it in a new script tag in the head section of a web page whenever you plan on using it.

I don't think that's the best way to include packages. How I imagined it would work is I include it in npm's package.json, include it in myFunction.js and let gulp handle putting it into dist/