jotson / LootTable.js

A loot drop table implementation in JavaScript
MIT License
44 stars 3 forks source link

added UMD support and create npm package file #1

Closed mreinstein closed 9 years ago

mreinstein commented 9 years ago

This is a nice little module. :) I've added support for AMD (requirejs), node and plain browser window globals. I've also added a package file so this could be published on npm.

jotson commented 9 years ago

Thanks for this. What I did was merge your changes into a new branch UMD and updated the package.json (hopefully correctly). The node version is great but I also wanted to keep the simplicity of the original... UMD is very JavaScript-y for beginners. :-)

mreinstein commented 9 years ago

What I did was merge your changes into a new branch UMD and updated the package.json (hopefully correctly)

It looks right, but the package hasn't been published. Do you have an account on npmjs? https://www.npmjs.com/search?q=LootTable

I also wanted to keep the simplicity of the original... UMD is very JavaScript-y for beginners. :-)

@jotson it's true that it is slightly more complicated for beginners, but I would wager that most beginners are not modifying LootTable. They are likely just calling the API. In that case, there is no difference to them; they can still add a script tag to the page and call it as a window global.

Modern libraries/modules are adopting this pattern so the code is usable by more people with different setups.

mreinstein commented 9 years ago

published to npm as loot-table: https://www.npmjs.com/package/loot-table