0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

doc: add added: information for globals

Ref: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/8901
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Luigi Pinca 2016-10-03 10:49:29 +02:00 committed by Anna Henningsen
parent eff6205fd0
commit bd0bedb86a
No known key found for this signature in database
GPG Key ID: D8B9F5AEAE84E4CF

View File

@ -10,6 +10,9 @@ The objects listed here are specific to Node.js. There are a number of
also globally accessible. also globally accessible.
## Class: Buffer ## Class: Buffer
<!-- YAML
added: v0.1.103
-->
<!-- type=global --> <!-- type=global -->
@ -18,6 +21,9 @@ also globally accessible.
Used to handle binary data. See the [buffer section][]. Used to handle binary data. See the [buffer section][].
## \_\_dirname ## \_\_dirname
<!-- YAML
added: v0.1.27
-->
<!-- type=var --> <!-- type=var -->
@ -45,6 +51,9 @@ References to `__dirname` within `b.js` will return
will return `/Users/mjr/app`. will return `/Users/mjr/app`.
## \_\_filename ## \_\_filename
<!-- YAML
added: v0.0.1
-->
<!-- type=var --> <!-- type=var -->
@ -65,24 +74,36 @@ console.log(__filename);
`__filename` isn't actually a global but rather local to each module. `__filename` isn't actually a global but rather local to each module.
## clearImmediate(immediateObject) ## clearImmediate(immediateObject)
<!-- YAML
added: v0.9.1
-->
<!--type=global--> <!--type=global-->
[`clearImmediate`] is described in the [timers][] section. [`clearImmediate`] is described in the [timers][] section.
## clearInterval(intervalObject) ## clearInterval(intervalObject)
<!-- YAML
added: v0.0.1
-->
<!--type=global--> <!--type=global-->
[`clearInterval`] is described in the [timers][] section. [`clearInterval`] is described in the [timers][] section.
## clearTimeout(timeoutObject) ## clearTimeout(timeoutObject)
<!-- YAML
added: v0.0.1
-->
<!--type=global--> <!--type=global-->
[`clearTimeout`] is described in the [timers][] section. [`clearTimeout`] is described in the [timers][] section.
## console ## console
<!-- YAML
added: v0.1.100
-->
<!-- type=global --> <!-- type=global -->
@ -91,6 +112,9 @@ console.log(__filename);
Used to print to stdout and stderr. See the [`console`][] section. Used to print to stdout and stderr. See the [`console`][] section.
## exports ## exports
<!-- YAML
added: v0.1.12
-->
<!-- type=var --> <!-- type=var -->
@ -103,6 +127,9 @@ when to use `module.exports`.
See the [module system documentation][] for more information. See the [module system documentation][] for more information.
## global ## global
<!-- YAML
added: v0.1.27
-->
<!-- type=global --> <!-- type=global -->
@ -114,6 +141,9 @@ variable. In Node.js this is different. The top-level scope is not the global
scope; `var something` inside an Node.js module will be local to that module. scope; `var something` inside an Node.js module will be local to that module.
## module ## module
<!-- YAML
added: v0.1.16
-->
<!-- type=var --> <!-- type=var -->
@ -128,6 +158,9 @@ available through `require()`.
See the [module system documentation][] for more information. See the [module system documentation][] for more information.
## process ## process
<!-- YAML
added: v0.1.7
-->
<!-- type=global --> <!-- type=global -->
@ -136,6 +169,9 @@ See the [module system documentation][] for more information.
The process object. See the [`process` object][] section. The process object. See the [`process` object][] section.
## require() ## require()
<!-- YAML
added: v0.1.13
-->
<!-- type=var --> <!-- type=var -->
@ -145,6 +181,9 @@ To require modules. See the [Modules][] section. `require` isn't actually a
global but rather local to each module. global but rather local to each module.
### require.cache ### require.cache
<!-- YAML
added: v0.3.0
-->
* {Object} * {Object}
@ -154,6 +193,10 @@ this does not apply to [native addons][], for which reloading will result in an
Error. Error.
### require.extensions ### require.extensions
<!-- YAML
added: v0.3.0
deprecated: v0.10.6
-->
> Stability: 0 - Deprecated > Stability: 0 - Deprecated
@ -178,23 +221,35 @@ away. However, it may have subtle bugs and complexities that are best
left untouched. left untouched.
### require.resolve() ### require.resolve()
<!-- YAML
added: v0.3.0
-->
Use the internal `require()` machinery to look up the location of a module, Use the internal `require()` machinery to look up the location of a module,
but rather than loading the module, just return the resolved filename. but rather than loading the module, just return the resolved filename.
## setImmediate(callback[, ...args]) ## setImmediate(callback[, ...args])
<!-- YAML
added: v0.9.1
-->
<!-- type=global --> <!-- type=global -->
[`setImmediate`] is described in the [timers][] section. [`setImmediate`] is described in the [timers][] section.
## setInterval(callback, delay[, ...args]) ## setInterval(callback, delay[, ...args])
<!-- YAML
added: v0.0.1
-->
<!-- type=global --> <!-- type=global -->
[`setInterval`] is described in the [timers][] section. [`setInterval`] is described in the [timers][] section.
## setTimeout(callback, delay[, ...args]) ## setTimeout(callback, delay[, ...args])
<!-- YAML
added: v0.0.1
-->
<!-- type=global --> <!-- type=global -->