I have a bunch of JS which I want to run as a standalone program using node.js and also within a browser. The code is divided into several file which are loaded as needed using "require", This works well with node.js, but not so well in a browser. In the browser I've tried using Smoothie, which provides a compatible version of "require", but I get a warning:
> "Synchronous XMLHttpRequest on the main thread is deprecated because of > its detrimental effects to the end user's experience. For more help > http://xhr.spec.whatwg.org/" > When I look at http://xhr.spec.whatwg.org/ I see this: > Synchronous XMLHttpRequest outside of workers is in the process of being > removed from the web platform as it has detrimental effects to the end > user's experience. > This presumably means that I should find a better implementation, otherwise one day I will suddenly find that my code no longer works. So, can anyone suggest an implementation of "require" that I can use in a browser that is (a) compatible with node.js, and (b) doesn't break any rules that will lead to trouble in the future? Many thanks for any advice... -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/f8ae6bbf-d83c-4d73-acb3-cd9525033393%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.