Consider it this way:
Is there an API is a set of classes, modules and methods that are specific to your environment. From nodejs is a set of modules, and browser your classes, methods and global objects. It turns out that you can write some code that will run on nodejs and in browsers if the code will not affect the API. For example if you write a game, can the game logic be abstracted from the API and write it once and it will work on backend and frontend. Thus it will be possible to start a simulation of the game player on the backend. Or you have an application where a server receives some data structure and you can write only once the classes who work with them (parsing, etc) and use from here and there.