Remove util.print from docs

Use process.stdout.write()
This commit is contained in:
Ryan Dahl 2010-11-07 17:22:36 -08:00
parent 07da49b095
commit c6029c75a4
6 changed files with 11 additions and 18 deletions

View File

@ -30,4 +30,4 @@
* [Assertion Testing](assert.html)
* Appendixes
* [Appendix 1: Recommended Third-party Modules](appendix_1.html)
* [Appendix 2: Deprecated API's](appendix_2.html)
* [Appendix 2: Deprecated API's](appendix_2.html)

View File

@ -30,4 +30,4 @@
# Appendixes
@include appendix_1
@include appendix_2
@include appendix_2

View File

@ -41,4 +41,4 @@ elsewhere.
[expresso](http://github.com/visionmedia/expresso),
[mjsunit.runner](http://github.com/tmpvar/mjsunit.runner)
Patches to this list are welcome.
Patches to this list are welcome.

View File

@ -74,11 +74,11 @@ Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the exit cod
ls = spawn('ls', ['-lh', '/usr']);
ls.stdout.on('data', function (data) {
util.print('stdout: ' + data);
console.log('stdout: ' + data);
});
ls.stderr.on('data', function (data) {
util.print('stderr: ' + data);
console.log('stderr: ' + data);
});
ls.on('exit', function (code) {
@ -98,7 +98,7 @@ Example: A very elaborate way to run 'ps ax | grep ssh'
});
ps.stderr.on('data', function (data) {
util.print('ps stderr: ' + data);
console.log('ps stderr: ' + data);
});
ps.on('exit', function (code) {
@ -109,11 +109,11 @@ Example: A very elaborate way to run 'ps ax | grep ssh'
});
grep.stdout.on('data', function (data) {
util.print(data);
console.log(data);
});
grep.stderr.on('data', function (data) {
util.print('grep stderr: ' + data);
console.log('grep stderr: ' + data);
});
grep.on('exit', function (code) {
@ -148,8 +148,8 @@ output, and return it all in a callback.
child = exec('cat *.js bad_file | wc -l',
function (error, stdout, stderr) {
util.print('stdout: ' + stdout);
util.print('stderr: ' + stderr);
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}

View File

@ -1 +1 @@
@include _toc.markdown
@include _toc.markdown

View File

@ -4,13 +4,6 @@ These functions are in the module `'util'`. Use `require('util')` to access
them.
### util.print(string)
Like `console.log()` but without the trailing newline.
require('util').print('String with no newline');
### util.debug(string)
A synchronous output function. Will block the process and