olegp / common-node Goto Github PK
View Code? Open in Web Editor NEWSynchronous CommonJS compatibility layer using node-fibers
Home Page: http://olegp.github.com/common-node/
Synchronous CommonJS compatibility layer using node-fibers
Home Page: http://olegp.github.com/common-node/
Remove connect, as it adds additional overhead and may do caching.
This caused problems with system.stdin before & is now causing issues with reusing the same stream for HTTP Keep Alive connections.
Hi,
Just wondering if there is a way to get something like Nodemon or node-supervisor to work with common-node, so that it is not necessary to restart the process to see JS file changes. I'm on Windows.
Thanks!
Ringo modules frequently use destructuring assignment, adding optional support for Traceur would allow for those modules to be used without modification.
... and bring it in line with the one in Ringo.
Hi,
I went through these steps:
No matter what I do (removing $NODE_PATH, changing directory to the examples folder and just executing hello.js, etc.) it seems I get "The system cannot find the path specified."
This is in line with Node.js
events.js:72 throw er; // Unhandled 'error' event ^ Error: spawn ENOENT at errnoException (child_process.js:945:11) at Process.ChildProcess._handle.onexit (child_process.js:736:34)
common-node/subprocess does this to the command line:
var arguments = command.split(' '); command = arguments.shift(); var child = childProcess.spawn(command, arguments,...);
which isn't going to fly...
via @alexlamsl
Looks like on('socket') no longer provides a socket as a parameter.
TypeError: Cannot call method 'setTimeout' of undefined
at HttpClient.read (httpclient.js:192:13)
at HttpClient.finish (httpclient.js:222:24)
path.js:313 throw new TypeError('Arguments to path.resolve must be strings'); ^ TypeError: Arguments to path.resolve must be strings at Object.exports.resolve (path.js:313:15) at module.exports (/home/oleg/Projects/common-node/lib/run.js:39:23) at Object. (/home/oleg/Projects/common-node/bin/common-node:3:22) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:903:3
/cc @alexlamsl
Ideally, I'd like to keep this as a single project/package so that RingoJS code such as the following would work as is:
require('system').exit(0);
Unfortunately Node's approach to resolving modules and proposed removal of exports.paths.push() makes this difficult. The options are:
fs
being a reserved module nameIf you have any other suggestions, please leave them in the comments below.
Thank you to @shangaslammi for bringing this up. To see what's broken, run the unit tests.
We probably need more unit tests to get full coverage. References:
... by using https://github.com/visionmedia/node-jscoverage
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit
at EventEmitter.<anonymous> (events.js:123:17)
at new <anonymous> (/common-node/lib/io.js:26:14)
at receive (/common-node/lib/jsgi.js:78:15)
To reproduce, try to connect to a different port. The problem is likely in common-node's httpclient and due to the for(;;) loop, but could be libuv/node related as well.
Hi,
With JSGI, I don't see a way to set the port. Is there a way to change it from 8080?
Also, how do I get command line options in Windows?
Thanks!
As @kof pointed out, this is already in Node core.
Need to make sure the removal doesn't break any of the tests.
When node -v v0.5.4 & npm -v 1.0.17 are used the following issues were spotted by @dsowsy:
npm root -g
returned an error about using the deprecated require.pathsfibers
and traceur
are installed in common-node/node_modules, however running tests gives error saying fibers
cannot be found; installing them manually globally fixed thisPlease try to reproduce this and comment here on how we could possibly address these issues.
Currently the whole process exits if an exception is thrown inside the request handler, should probably just have it return a 503 instead.
works fine under v0.8.18 (Windows 32-bit)
node_modules\common-node\lib\io.js:88 fiber.run(); ^ Error: socket hang up at createHangUpError (http.js:1360:15) at ServerResponse.OutgoingMessage._writeRaw (http.js:507:26) at ServerResponse.OutgoingMessage._send (http.js:476:15) at ServerResponse.OutgoingMessage.end (http.js:887:18) at send (node_modules\common-node\lib\httpserver.js:117:12) at exports.jsgi (node_modules\common-node\lib\httpserver.js:128:7)
seems like this could be a real winning framework combination but needs some better simple CRUD examples to get folks like us using it. I looked at this last night but really couldn't easily get going with a simple app.
we like the use of fibers - regardless of what folks on the node forum say, callbacks are not easy, and most developers prefer simple sequential programming. Hence, the popularity of Rails. Also really like use use of Mongo shell commands as in Mongolian. Also the use of simple templates like ejs and Mustache.
BUT, there needs to be some simple examples to get folks going with common CRUD type apps - I suggest the project needs the 5 min blog and to-do examples. Even a simple hello world with a form to input name and then a template that reports "Hello " with a typical directory structure.
http://olegp.github.com/common-node/graphs/buffer-alloc.png
Results are far worse than other benchmarks, most likely due to the slow zero() function. Should try using clear from https://github.com/bnoordhuis/node-buffertools/ or drop the requirement to clear the buffer (this would break tests though).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.