You may know the software called OBS studio: by only knowing the live stream key, it sends live stream to YouTube.
I am supposing that it is using some kind of YouTube API to do that. If that's the case what is that API? Can I use this with Node.js?
Google offers an API that is quite reach of features: YouTube Live Streaming API.
You may begin your journey by reading the official getting started doc: YouTube Live Streaming API Overview. Then I recommend absorbing these two important documents: Life of a Broadcast and Understanding Broadcasts and Streams.
Depending of the type of application you intend to develop (desktop app or server-side web app), you need to get acquainted with the so-called OAuth 2.0 authentication/authorization flows (since all the endpoints of this API require OAuth): OAuth 2.0 Flow: Installed apps or OAuth 2.0 Flow: Server-side web apps.
For what concerns Node.js, Google has made available a client library: Google API Client Library for Node.js (alpha); and also some Node.js sample code, that, unfortunately, does not yet include programs exercising the Live Streaming API.
There is the YouTube Live Streaming API. It is an HTTP-based API, so you will be able to access it from Node.js as well as basically any other programming language capable of making HTTP-requests.