bitjson/typescript-starter

Browser build & testing

Closed this issue · 2 comments

Need to add an example of the library using functionality of a built-in Node.js module, while also providing a browser fallback.

Probably a sha256 method which just accepts a string and returns it's sha256 digest. In Node.js, it should use the (fast, native) built-in hash function. In the browser, it should fall back to hash.js.

The browser build can also replace the module build (for now), since ES6 modules are (currently) only able to be used by browser build systems. When a version of Node.js supports ES6 modules, we'll add the module build back.

The browser build should be tested with karma-ava or something similar. (Bonus: both builds will be fully-tested, so the language here can be revised.)

(I posted this question on Stack Overflow too: http://stackoverflow.com/questions/42357548/)

Closed by #13