Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 222
soren.bendtsen Avatar asked Apr 21 '17 20:04

soren.bendtsen


1 Answers

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";

like image 72
Saravana Avatar answered Sep 18 '22 20:09

Saravana