Commit Graph

39 Commits

Author SHA1 Message Date
Ryan Dahl
7ddf1f569a Improve error message for requiring system modules. 2009-09-20 18:03:55 +02:00
Ryan Dahl
c8b143bf30 Absolute path names for require() refer to node.libraryPaths 2009-09-19 17:21:12 +02:00
Ryan Dahl
9db2e5f375 Default to utf8 encoding for node.fs.cat() 2009-09-15 22:41:25 +02:00
Ryan Dahl
083d150bc4 Add node.exec() 2009-09-15 15:42:16 +02:00
Ryan
dbe116ddfe API: Change arguments of emit(), emitSuccess(), emitError()
Instead of

  myemitter.emit("event", [arg1, arg2, arg3]);

the API is now

  myemitter.emit("event", arg1, arg2, arg3);

This change saves the creation of an extra array object for each event.
The implementation is also slightly more simple.
2009-09-12 14:21:37 +02:00
Ryan
063890b8da Internally use full paths when loading modules.
This completes shebang support begun in
6acac912dd.
2009-09-07 14:46:56 +02:00
Ryan
1a2696f10a Almost completely remove onExit and onLoad.
They were deprecated in 723c7d9f7c and
31265be4a6.

Still retaining error message.
2009-09-07 14:45:48 +02:00
Ryan
0407145c11 Exit the process on module load error. (temporary) 2009-09-07 14:13:32 +02:00
Ryan
78bb53b009 Set module.loaded=true for dll modules. 2009-09-01 15:43:56 +02:00
Ryan
a97dce7523 Build static executable.
- Fix a few errors with node.dlopen()

- Report errors to stderr (this should probably be a separate commit, but
  whatever)
2009-08-31 11:45:44 +02:00
Ryan
ad9d683f9f API: rename node.Process to node.ChildProcess
This is to avoid confusion with the global "process" object, especially for
the instances of node.Process.
2009-08-26 22:36:45 +02:00
Ryan
723c7d9f7c Replace onExit() with process.addListener("exit")
- Update documentation.

- Depreciation message for onExit().
2009-08-26 22:14:44 +02:00
Ryan
31265be4a6 Depreciate onLoad 2009-08-26 22:14:44 +02:00
Ryan
79f121044c Synchronous module loading.
`include` and `require now` call `promise.wait` on their retrieval functions
making them synchronous.  Introduce `include_async` and `require_async` to
do asynchronous retrievals.

`include_async` and `require_async` need testing and documentation.

Update documentation for include, require().  I am mostly removing
information about onLoad(). onLoad is to be depreciated.
2009-08-26 22:14:01 +02:00
Ryan
17c6a67f15 Introduce node.stdio
Remove old stdout, stderr, stdin objects.
2009-08-24 21:20:26 +02:00
Ryan
6acac912dd Initial support for shebang.
There are some issues with loading modules from shebang-executed scripts
that will still need to be addressed, but this works for simple single
script situations.
2009-08-03 18:42:56 +02:00
Ryan
e25afc35bd Hack to fix module line numbers in stack traces.
This code is going to be refactored with the introduction of the "process"
object. This is just temporary.
2009-07-31 18:49:30 +02:00
Ryan
b07dc31e1b root_module should be a local variable 2009-07-20 18:30:15 +02:00
Ryan
eb10553634 Move node.inherit, node.path, node.cat to new file: util.js 2009-07-16 17:19:36 +02:00
Joshaven Potter
4b9f26c51a validate js 2009-07-01 02:33:08 +02:00
Ryan
8047b912c0 Change 'new node.tcp.Connection' to 'node.tcp.createConnection' 2009-06-30 13:56:52 +02:00
Ryan
d56552dc66 Remove node.Process constructor from API 2009-06-30 13:46:35 +02:00
Ryan
d428eff023 Snakecase events . 2009-06-29 13:18:30 +02:00
Ryan
65324866bc Implement Promises for file i/o 2009-06-28 19:08:27 +02:00
Ryan
b4af3b9fb5 Timers on Events 2009-06-28 19:08:25 +02:00
Ryan
2ecd7ffe54 in the middle putting in event code. broken. 2009-06-28 19:08:25 +02:00
Ryan
dce072a67e lint 2009-06-22 13:12:47 +02:00
Urban Hafner
ea290e727d Finished remote module loading 2009-06-21 16:59:11 +02:00
Urban Hafner
ad15067ea0 Tests and implementation of node.cat() 2009-06-21 16:40:08 +02:00
Ryan
ddac43f4ba Allow for absolute paths to specify root module 2009-06-09 10:06:04 +02:00
Ryan
8b49cef10b Modify the tests to use onExit hook.
No need to rely on stdout output now.
onExit callbacks should print stack trace from onExit failure
2009-06-08 19:10:36 +02:00
Ryan
f6a7fe2657 Implement onExit() hook for modules.
onExit() is similar to the onLoad() callback. onExit() is called on each
module just before the process exits. This can be used to check state in
unit tests, but not to perform I/O. The process will forcibly exit as soon
as all of the onExit callbacks are made.
2009-06-08 16:17:33 +02:00
Ryan
b6fe4aec50 Module system refactor
There is one major API change in the refactor: filename extensions are now
required when requiring or including modules.

Added extra test to test-module-loading.js.
2009-06-08 15:34:15 +02:00
Ryan
ed283dc280 Fix bug: catting non-existent files 2009-06-01 12:56:28 +02:00
Ryan
e8f177aa2d Clean up outgoing encoding API. Generally: send(chunk, encoding). 2009-05-26 17:48:59 +02:00
Ryan
d1b0ce6d37 Large refactor of file code.
All the c++ code is now reduced to simple wrappers. The node.fs.File object
is defined entirely in javascript now. As is the actionQueue methods.

This makes the boundaries much cleaner. There is still some thought that
needs to go into how exactly the API should behave but this simplification
is a first step.
2009-05-26 03:30:51 +02:00
Ryan
3eb4819db1 Add docs. Rename exit() to node.exit(). 2009-05-25 13:38:36 +02:00
Ryan
58c13e5192 Namespace File stuff in node.fs 2009-05-21 12:49:41 +02:00
Ryan
3212b31ea1 Rename main.js to node.js. 2009-05-13 21:43:24 +02:00