Use this library to open and connect to UNIX sockets, send requests and get responses similar to a fetch request. This library supports basic response chunk decoding.
Connect to the docker.sock UNIX socket, send a request to /containers/json and log the response.
import{Socket}from'@typescriptplayground/socket';constsocket=newSocket('/var/run/docker.sock');awaitsocket.request('/containers/json').then((res)=>res.json()).then((json)=>console.log(json));