Years before I knew about node, I wrote two client-side JavaScript libraries, 
one of which uses the other, each providing about half a dozen classes. Now I 
would like to modernize these libraries to make them most accessible to today's 
web developers.

What is the best way to write my modules so they can be included in any 
client-side or server-side JavaScript environment?

I would like to publish them to npm. To that end, I've started switching them 
to node-style require() and module.exports, but of course I can't use those 
files in the browser ("module is not defined") without a build step such as 
browserify, or adding boilerplate to each file, and I don't want to bloat my 
library too much.

I don't want to mandate that my users use an AMD loader, or a CommonJS loader, 
or RequireJS or curl.js or anything else; I want my libraries to be compatible 
with any script loading method of the user's choosing.

Avoiding the build step during development would be nice too. I'd like to be 
able to just include the dozen class files in script tags and use them.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
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 post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to