The 'run everywhere boilerplate' isn't working for Node.js. My understanding is that Node.js is a CommonJS environment, although the boilerplate runs it as a 'direct script'.
A solution working for me is to add this before the other if cases:
if typeof module isnt 'undefined' and typeof exports isnt 'undefined'
# Node.js environment
factory(exports)
Hi,
The 'run everywhere boilerplate' isn't working for Node.js. My understanding is that Node.js is a CommonJS environment, although the boilerplate runs it as a 'direct script'.
A solution working for me is to add this before the other if cases:
But perhaps a better approach is: https://gist.github.com/1663811