soren.bendtsen
soren.bendtsen

Reputation: 435

TypeScript definition for builtin 'net' NodeJS types?

I am trying to write a TCP client application, and for that the builtin 'net' package seems to do the job. However, I am not able to find the TypeScript definitions for the package.

https://nodejs.org/api/net.html

Since it is built into NodeJs, I am almost sure it exists, but it cannot find any information about it anywhere.

Thanks!

Upvotes: 8

Views: 7579

Answers (1)

Saravana
Saravana

Reputation: 40534

They are available in the official typings for node. Install it with npm install @types/node --save-dev and you can import it in your TypeScript code using: import * as net from "net";

Upvotes: 22

Related Questions