Skip to content

Commit

Permalink
meta: fixed some api docs links
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd committed Nov 24, 2023
1 parent 98744ef commit db7f2e6
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion pages/en/blog/release/v20.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ This feature was contributed by Antoine du Hamel in <https://github.com/nodejs/n

#### Node.js C++ addons now have experimental support for cppgc (Oilpan), a C++ garbage collection library in V8.

Now when Node.js starts up, it makes sure that there is a `v8::CppHeap` attached to the V8 isolate. This enables users to allocate in the `v8::CppHeap` using `<cppgc/*>` headers from V8, which are now also included into the Node.js headers available to addons. Note that since Node.js only bundles the cppgc library coming from V8, [the ABI stability](https://nodejs.org/docs/guides/abi-stability#abi-stability-in-nodejs) of cppgc is currently not guaranteed in semver-minor and -patch updates, but we do not expect the ABI to break often, as it has been stable and battle-tested in Chromium for years. We may consider including cppgc into the ABI stability guarantees when it gets enough adoption internally and externally.
Now when Node.js starts up, it makes sure that there is a `v8::CppHeap` attached to the V8 isolate. This enables users to allocate in the `v8::CppHeap` using `<cppgc/*>` headers from V8, which are now also included into the Node.js headers available to addons. Note that since Node.js only bundles the cppgc library coming from V8, [the ABI stability](/docs/guides/abi-stability#abi-stability-in-nodejs) of cppgc is currently not guaranteed in semver-minor and -patch updates, but we do not expect the ABI to break often, as it has been stable and battle-tested in Chromium for years. We may consider including cppgc into the ABI stability guarantees when it gets enough adoption internally and externally.

To help addon authors create JavaScript-to-C++ references of which V8's garbage collector can be aware, a helper function [`node::SetCppgcReference(isolate, js_object, cppgc_object)`](https://github.com/nodejs/node/blob/v20.6.0/test/addons/cppgc-object/binding.cc) has been added to `node.h`. V8 may provide a native alternative in the future, which could then replace this Node.js-specific helper. In the mean time, users can use this API to avoid having to hard-code the layout of JavaScript wrapper objects. An example of how to create garbage-collected C++ objects in the unified heap and wrap it in a JavaScript object can be found in the [Node.js addon tests](https://github.com/nodejs/node/blob/v20.6.0/test/addons/cppgc-object/binding.cc).

Expand Down
2 changes: 1 addition & 1 deletion pages/en/blog/release/v8.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ as well.
The [N-API](https://nodejs.org/api/n-api.html) is experimental in Node.js 8.0.0,
so significant changes in the implementation and API should be expected. Native
addon developers are
[encouraged to begin working with the API](https://nodejs.org/docs/guides/publishing-napi-modules/)
[encouraged to begin working with the API](/docs/guides/publishing-napi-modules/)
as soon as possible and to provide feedback that will be necessary to ensure
that the new API meets the needs of the ecosystem.

Expand Down
6 changes: 3 additions & 3 deletions pages/en/docs/guides/diagnostics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ root-cause their issues.

This is the available set of diagnostics guides:

- [Memory](https://nodejs.org/docs/guides/diagnostics/memory)
- [Live Debugging](https://nodejs.org/docs/guides/diagnostics/live-debugging)
- [Poor Performance](https://nodejs.org/docs/guides/diagnostics/poor-performance)
- [Memory](/docs/guides/diagnostics/memory)
- [Live Debugging](/docs/guides/diagnostics/live-debugging)
- [Poor Performance](/docs/guides/diagnostics/poor-performance)

[Diagnostics Working Group]: https://github.com/nodejs/diagnostics
2 changes: 1 addition & 1 deletion pages/en/docs/guides/diagnostics/live-debugging/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ application executes for a certain trigger like an incoming HTTP request. They
may also want to step through the code and control the execution as well as
inspect what values variables hold in memory.

- [Using Inspector](https://nodejs.org/docs/guides/diagnostics/live-debugging/using-inspector)
- [Using Inspector](/docs/guides/diagnostics/live-debugging/using-inspector)
6 changes: 3 additions & 3 deletions pages/en/docs/guides/diagnostics/memory/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ type of objects take and what variables are preventing them from being garbage
collected. It can also help to know the allocation pattern of our program over
time.

- [Using Heap Profiler](https://nodejs.org/docs/guides/diagnostics/memory/using-heap-profiler/)
- [Using Heap Snapshot](https://nodejs.org/docs/guides/diagnostics/memory/using-heap-snapshot/)
- [GC Traces](https://nodejs.org/docs/guides/diagnostics/memory/using-gc-traces)
- [Using Heap Profiler](/docs/guides/diagnostics/memory/using-heap-profiler/)
- [Using Heap Snapshot](/docs/guides/diagnostics/memory/using-heap-snapshot/)
- [GC Traces](/docs/guides/diagnostics/memory/using-gc-traces)
4 changes: 2 additions & 2 deletions pages/en/docs/guides/diagnostics/poor-performance/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ the others. When we do this locally, we usually try to optimize our code.

This document provides two simple ways to profile a Node.js application:

- [Using V8 Sampling Profiler](https://nodejs.org/docs/guides/simple-profiling/)
- [Using Linux Perf](https://nodejs.org/docs/guides/diagnostics/poor-performance/using-linux-perf)
- [Using V8 Sampling Profiler](/docs/guides/simple-profiling/)
- [Using Linux Perf](/docs/guides/diagnostics/poor-performance/using-linux-perf)
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ visualization.

![Example nodejs flamegraph](https://user-images.githubusercontent.com/26234614/129488674-8fc80fd5-549e-4a80-8ce2-2ba6be20f8e8.png)

To generate a flamegraph from this result, follow [this tutorial](https://nodejs.org/docs/guides/diagnostics-flamegraph/#create-a-flame-graph-with-system-perf-tools)
To generate a flamegraph from this result, follow [this tutorial](/docs/guides/diagnostics-flamegraph/#create-a-flame-graph-with-system-perf-tools)
from step 6.

Because `perf` output is not a Node.js specific tool, it might have issues with how JavaScript code is optimized in
Node.js. See [perf output issues](https://nodejs.org/docs/guides/diagnostics-flamegraph/#perf-output-issues) for a
Node.js. See [perf output issues](/docs/guides/diagnostics-flamegraph/#perf-output-issues) for a
futher reference.

## Useful Links
Expand Down
24 changes: 12 additions & 12 deletions pages/en/docs/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ layout: docs.hbs

## General

- [Debugging - Getting Started](https://nodejs.org/docs/guides/debugging-getting-started/)
- [Easy profiling for Node.js Applications](https://nodejs.org/docs/guides/simple-profiling/)
- [Diagnostics - Flame Graphs](https://nodejs.org/docs/guides/diagnostics-flamegraph/)
- [Diagnostics - User Journey](https://nodejs.org/docs/guides/diagnostics/)
- [Security Best Practices](https://nodejs.org/docs/guides/security/)
- [Debugging - Getting Started](/docs/guides/debugging-getting-started/)
- [Easy profiling for Node.js Applications](/docs/guides/simple-profiling/)
- [Diagnostics - Flame Graphs](/docs/guides/diagnostics-flamegraph/)
- [Diagnostics - User Journey](/docs/guides/diagnostics/)
- [Security Best Practices](/docs/guides/security/)

## Node.js core concepts

- [The Node.js Event Loop, Timers, and `process.nextTick()`](https://nodejs.org/docs/guides/event-loop-timers-and-nexttick/)
- [Don't Block the Event Loop (or the Worker Pool)](https://nodejs.org/docs/guides/dont-block-the-event-loop/)
- [The Node.js Event Loop, Timers, and `process.nextTick()`](/docs/guides/event-loop-timers-and-nexttick/)
- [Don't Block the Event Loop (or the Worker Pool)](/docs/guides/dont-block-the-event-loop/)

## Module-related guides

- [Anatomy of an HTTP Transaction](https://nodejs.org/docs/guides/anatomy-of-an-http-transaction/)
- [Working with Different Filesystems](https://nodejs.org/docs/guides/working-with-different-filesystems/)
- [Backpressuring in Streams](https://nodejs.org/docs/guides/backpressuring-in-streams/)
- [How to publish N-API package](https://nodejs.org/docs/guides/publishing-napi-modules/)
- [ABI Stability](https://nodejs.org/docs/guides/abi-stability/)
- [Anatomy of an HTTP Transaction](/docs/guides/anatomy-of-an-http-transaction/)
- [Working with Different Filesystems](/docs/guides/working-with-different-filesystems/)
- [Backpressuring in Streams](/docs/guides/backpressuring-in-streams/)
- [How to publish N-API package](/docs/guides/publishing-napi-modules/)
- [ABI Stability](/docs/guides/abi-stability/)
4 changes: 2 additions & 2 deletions pages/en/learn/asynchronous-work/the-nodejs-event-emitter.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors: flaviocopes, MylesBorins, fhemberger, LaRuaNa, ahmadawais, ovflowd

If you worked with JavaScript in the browser, you know how much of the interaction of the user is handled through events: mouse clicks, keyboard button presses, reacting to mouse movements, and so on.

On the backend side, Node.js offers us the option to build a similar system using the [`events` module](https://nodejs.org/api/events/).
On the backend side, Node.js offers us the option to build a similar system using the [`events` module](https://nodejs.org/api/events.html).

This module, in particular, offers the `EventEmitter` class, which we'll use to handle our events.

Expand Down Expand Up @@ -67,4 +67,4 @@ The EventEmitter object also exposes several other methods to interact with even
- `removeListener()` / `off()`: remove an event listener from an event
- `removeAllListeners()`: remove all listeners for an event

You can read more about these methods in the [official documentation](https://nodejs.org/api/events/).
You can read more about these methods in the [official documentation](https://nodejs.org/api/events.html).
2 changes: 1 addition & 1 deletion pages/en/learn/command-line/how-to-use-the-nodejs-repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ local.on('exit', () => {
});
```

You can read more about the REPL module in the [repl documentation](https://nodejs.org/api/repl/).
You can read more about the REPL module in the [repl documentation](https://nodejs.org/api/repl.html).
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors: flaviocopes, potch, MylesBorins, fhemberger, LaRuaNa, amiller-gh, ahmad

### Basic output using the console module

Node.js provides a [`console` module](https://nodejs.org/api/console/) which provides tons of very useful ways to interact with the command line.
Node.js provides a [`console` module](https://nodejs.org/api/console.html) which provides tons of very useful ways to interact with the command line.

It is basically the same as the `console` object you find in the browser.

Expand Down
4 changes: 2 additions & 2 deletions pages/en/learn/manipulating-files/nodejs-file-stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors: flaviocopes, ZYSzys, MylesBorins, fhemberger, LaRuaNa, ahmadawais, clea

# Node.js file stats

Every file comes with a set of details that we can inspect using Node.js. In particular, using the `stat()` method provided by the [`fs` module](https://nodejs.org/api/fs/).
Every file comes with a set of details that we can inspect using Node.js. In particular, using the `stat()` method provided by the [`fs` module](https://nodejs.org/api/fs.html).

You call it passing a file path, and once Node.js gets the file details it will call the callback function you pass, with 2 parameters: an error message, and the file stats:

Expand Down Expand Up @@ -78,4 +78,4 @@ async function example() {
example();
```

You can read more about the `fs` module in the [official documentation](https://nodejs.org/api/fs/).
You can read more about the `fs` module in the [official documentation](https://nodejs.org/api/fs.html).
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ async function example() {
example();
```

To see more details about the `fs/promises` module, please check [fs/promises API](https://nodejs.org/api/fs/#promise-example).
To see more details about the `fs/promises` module, please check [fs/promises API](https://nodejs.org/api/fs.html#promise-example).
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fs.writeFile('/Users/joe/test.txt', content, { flag: 'a+' }, err => {});
| `a` | This flag opens the file for **writing** and it also positions the stream at the **end** of the file ||
| `a+` | This flag opens the file for **reading** and **writing** and it also positions the stream at the **end** of the file ||

- You can find more information about the flags in the [fs documentation](https://nodejs.org/api/fs/#file-system-flags).
- You can find more information about the flags in the [fs documentation](https://nodejs.org/api/fs.html#file-system-flags).

## Appending content to a file

Expand Down

0 comments on commit db7f2e6

Please sign in to comment.