The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]



"Проект Deno развивает защищённую JavaScript-платформу, похож..."
Версия для распечатки Пред. тема | След. тема
Форум Разговоры, обсуждение новостей
Исходное сообщение [ Отслеживать ]
Подсказка: Для контроля за появлением новых сообщений - перед выходом жмите "Пометить прочитанным".
. "Проект Deno развивает защищённую JavaScript-платформу, похож..." +/
Сообщение от Аноним (4), 17-Фев-20, 22:33 
> How do you import to a specific version?

Simply specify the version in the URL. For example, this URL fully specifies the code being run: https://unpkg.com/liltest@0.0.5/dist/liltest.js. Combined with the aforementioned technique of setting $DENO_DIR in production to stored code, one can fully specify the exact code being run, and execute the code without network access.

> It seems unwieldy to import URLs everywhere. What if one of the URLs links to a subtly different version of a library?

Isn't it error prone to maintain URLs everywhere in a large project? The solution is to import and re-export your external libraries in a central deps.ts file (which serves the same purpose as Node's package.json file). For example, let's say you were using the above assertion library across a large project. Rather than importing "https://deno.land/std/testing/asserts.ts" everywhere, you could create a deps.ts file that exports the third-party code.

Ответить | Правка | Наверх | Cообщить модератору

Оглавление
Проект Deno развивает защищённую JavaScript-платформу, похож..., opennews, 17-Фев-20, 22:24  [смотреть все]
Форумы | Темы | Пред. тема | След. тема



Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру