[Pas2js] pas2js node

Michael Van Canneyt michael at freepascal.org
Tue Oct 3 16:21:08 CEST 2023



On Tue, 3 Oct 2023, Peter via Pas2js wrote:

>
> Hi guys,
>
> is it possible to build a websocket server with pas2js and the node modules?

Yes, it is.

Node does not have websockets built-in, so you may need to use a third-party
library such as "ws" if you don't want to write the socket server from
scratch.

We don't provide a unit that describes the ws library, but using dts2pas you
should be able to create the unit, since there is a typescript module
description available in the DefinitelyTyped repo.

See the following article, it describes how to go about it:

https://www.freepascal.org/~michael/articles/#typescript

If you need help, feel free to mail me.

Michael.


More information about the Pas2js mailing list