web3.js is the Ethereum JavaScript API that connects to the Generic JSON-RPC spec. It is composed of a selection of libraries that make it possible to interact with a local or remote ethereum node, using a HTTP or IPC connection. The node may be local, hosted by the DApp provider, or a public gateway such as Infura, which operates free Ethereum access points. It is necessary to run a local or remote Ethereum node to be able to use this library.
web3.js is directly usable on web technology and is also commonly used on the server side in Node.js applications and in Electron-based desktop applications.