0

According to the v8 wikipedia link:

V8 is intended to be used both in a browser and as a standalone high-performance engine that can be integrated into independent projects. V8 is used in the following software:

  • Google Chrome and all other Chromium-based web browsers, including Brave, Opera and Vivaldi ...

  • Node.js runtime environment

That in mind - nodejs is also using libuv to handle asynchronous events:

Node.js uses libuv to handle asynchronous events. Libuv is an abstraction layer for network and file system functionality on both Windows and POSIX-based systems such as Linux, macOS, OSS on NonStop, and Unix.

Since both browsers and nodejs share common parts which are not part of the web api or nodes own api.

I assume that some features, which could be done with libuv - are implemented differently from the the browser.

What are some examples of API/JS implementations that are different between the two?

5
  • what do you mean by different? Commented May 16, 2019 at 8:58
  • Code that elevates the powers of libuv vs. the browser implementation which cannot do that. Commented May 16, 2019 at 9:17
  • Not sure I understand your question correctly but Timers API is implemented differently. Because ref/unref makes no sense in context of browser. Try typeof setTimeout(() => {}) Commented May 16, 2019 at 9:19
  • Great example! Do you have more? Commented May 16, 2019 at 9:33
  • There is a talk of Bert Belder: youtube.com/watch?v=5soA6MCRODg explaining how the event loop in NodeJS made. Hope that gets you in the right direction. Commented May 16, 2019 at 9:44

1 Answer 1

1

Quoting from here

Libuv is the library that provides the event loop to Node.js

So basically this answer should give you an idea I suppose.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.