Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

doc: util: add args to format and methods error, puts, print #3164

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion doc/api/util.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ These functions are in the module `'util'`. Use `require('util')` to access
them.


## util.format()
## util.format(format, [...])

Returns a formatted string using the first argument as a `printf`-like format.

Expand Down Expand Up @@ -44,6 +44,20 @@ output `string` immediately to `stderr`.

require('util').debug('message on stderr');

## util.error([...])

Same as `util.debug()` except this will output all arguments immediately to
`stderr`.

## util.puts([...])

A synchronous output function. Will block the process and output all arguments
to `stdout` with newlines after each argument.

## util.print([...])

A synchronous output function. Will block the process, cast each argument to a
string then output to `stdout`. Does not place newlines after each argument.

## util.log(string)

Expand Down