Warning: mkdir(): No space left on device in /var/www/tgoop/post.php on line 37

Warning: file_put_contents(aCache/aDaily/post/backendmaster/--): Failed to open stream: No such file or directory in /var/www/tgoop/post.php on line 50
Backend-Мастер@backendmaster P.179
BACKENDMASTER Telegram 179
​​Как создать npm пакет на typescript?

- Куда помещать typescript и javascript файлы?
Куда вам удобно

- Для чего нужно создавать папку dist?
Обычно вы пишете исходники в TS. Потому компилируете его в JS и публикуете JS. Обычно в папке dist лежит именно скомпилированный js.

- Какой файл указывать в package.json, .ts или .js?
js.

- Надо ли создавать .d.ts файлы?
Да

- Добавлять ли "type": "module" в package.json?
- Использовать export или module.exports?
Зависит от того, в какой формат вы компилируете ваш JS

- Надо ли создавать @types/проект, и если да что нужно делать там?
Нет. Это нужно только в тех случаях, если ваши d.ts файлы не включены в сам пакет.

Step by step: Building and publishing an NPM Typescript package.

Подробнее: https://itnext.io/step-by-step-building-and-publishing-an-npm-typescript-package-44fe7164964c



tgoop.com/backendmaster/179
Create:
Last Update:

​​Как создать npm пакет на typescript?

- Куда помещать typescript и javascript файлы?
Куда вам удобно

- Для чего нужно создавать папку dist?
Обычно вы пишете исходники в TS. Потому компилируете его в JS и публикуете JS. Обычно в папке dist лежит именно скомпилированный js.

- Какой файл указывать в package.json, .ts или .js?
js.

- Надо ли создавать .d.ts файлы?
Да

- Добавлять ли "type": "module" в package.json?
- Использовать export или module.exports?
Зависит от того, в какой формат вы компилируете ваш JS

- Надо ли создавать @types/проект, и если да что нужно делать там?
Нет. Это нужно только в тех случаях, если ваши d.ts файлы не включены в сам пакет.

Step by step: Building and publishing an NPM Typescript package.

Подробнее: https://itnext.io/step-by-step-building-and-publishing-an-npm-typescript-package-44fe7164964c

BY Backend-Мастер




Share with your friend now:
tgoop.com/backendmaster/179

View MORE
Open in Telegram


Telegram News

Date: |

Administrators Image: Telegram. According to media reports, the privacy watchdog was considering “blacklisting” some online platforms that have repeatedly posted doxxing information, with sources saying most messages were shared on Telegram. The creator of the channel becomes its administrator by default. If you need help managing your channel, you can add more administrators from your subscriber base. You can provide each admin with limited or full rights to manage the channel. For example, you can allow an administrator to publish and edit content while withholding the right to add new subscribers. While some crypto traders move toward screaming as a coping mechanism, many mental health experts have argued that “scream therapy” is pseudoscience. Scientific research or no, it obviously feels good.
from us


Telegram Backend-Мастер
FROM American