pure js implementation of comlink2 serial protocol