Do you need packages and modules in browser?
With require.js you can "define" and "require" something (AmdJS spec) in 
15kb. Need run node.js  in browser? r.js implement it in 1007kb based on 
require.js. 
With browserify you can "exports" and "require" like in node.js(CommonJS 
spec), but browserify will add at least minified 150 bytes for your every 
file, and browserify is a nodejs packages itself, and It has about 1000+ 
lines(index.js:750 lines, bin/cmd.js: 75 lines, bin/args.js: 233 lines). 
Is it possible to make node.js module run in browser by 1 kb javascript 
code?
Yes. With twoside.js, we can have the basic features of browserify and some 
other flexibilities by 1kb. 
After adding twoside.js(100 lines, 1000 bytes) with <script> tag, you can 
use package and modules like in modules, by wrapping module with one 
line(120 bytes). and with gulp-twoside.js(75 lines) you can wrap the 
modules automatically and get some other features.
1kb can make it.
To get twoside.js, please "npm install twoside", or go to 
https://github.com/chaosim/twoside
 

-- 
-- 
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to