Languages
[Edit]
EN

TypeScript / Node.js - install Node types (type declarations)

6 points
Created by:
Zayaan-Rasmussen
543

In this article, we would like to show you how to install and use Node types in TypeScript under Node.js.

Simple steps:

1. install TypeScript Node.js types, using:

2. add packages using import keyword, e.g.:

 

Practical example

Edit

In this example, after installing Node types with the above command, we import and use the path module using the import keyword.

Output:

References

Edit
  1. https://www.npmjs.com/package/@types/node
  2. Path | Node.js v17.8.0 Documentation

Alternative titles

  1. TypeScript / Node.js - add Node types (type declarations)
  2. TypeScript / Node.js - install and use Node types (type declarations)
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join