{"id":419306,"date":"2022-03-21T14:45:07","date_gmt":"2022-03-21T11:45:07","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/whats-new-in-deno-1-19-cloudsavvy-it\/"},"modified":"2022-03-21T14:45:07","modified_gmt":"2022-03-21T11:45:07","slug":"whats-new-in-deno-1-19-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/whats-new-in-deno-1-19-cloudsavvy-it\/","title":{"rendered":"#What\u2019s New In Deno 1.19? \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a3056a01b232\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a3056a01b232\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-deno-1-19-cloudsavvy-it\/#%E2%80%9CWhats_New_In_Deno_119_%E2%80%93_CloudSavvy_IT%E2%80%9D\" >&#8220;What\u2019s New In Deno 1.19? \u2013 CloudSavvy IT&#8221;<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-deno-1-19-cloudsavvy-it\/#Permission_Prompts\" >Permission Prompts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-deno-1-19-cloudsavvy-it\/#Native_Web_Streams\" >Native Web Streams<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-deno-1-19-cloudsavvy-it\/#Simple_Stream_Compression\" >Simple Stream Compression<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-deno-1-19-cloudsavvy-it\/#Vendored_Dependencies\" >Vendored Dependencies<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-deno-1-19-cloudsavvy-it\/#Improved_Development_Experience\" >Improved Development Experience<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-deno-1-19-cloudsavvy-it\/#Upgrading\" >Upgrading<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/buradabiliyorum.com\/en\/whats-new-in-deno-1-19-cloudsavvy-it\/#Summary\" >Summary<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E2%80%9CWhats_New_In_Deno_119_%E2%80%93_CloudSavvy_IT%E2%80%9D\"><\/span>&#8220;What\u2019s New In Deno 1.19? \u2013 CloudSavvy IT&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage aligncenter size-full wp-image-14557\" data-pagespeed-lazy-srcset=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/10\/47891d3f.jpg?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/10\/47891d3f.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/10\/47891d3f.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Graphic showing the Deno JavaScript runtime logo\" width=\"1600\" height=\"900\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Deno 1.19 was <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/deno.com\/blog\/v1.19\">released in February 2022<\/a> as the latest incremental update for the secure-by-design Java<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">Script<\/a> runtime. Among the changes are a streamlined permissions management experience, first-class support for vendored dependencies, and new native web streams for files, network sockets, and standard input and output.<\/p>\n<p>In this article we\u2019ll look at the major additions and improvements that will alter how you use Deno. You can get the full low-down on the release from the changelog on the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/deno.com\/blog\/v1.19\">Deno blog<\/a>.<\/p>\n<h2 id=\"permission-prompts\"><span class=\"ez-toc-section\" id=\"Permission_Prompts\"><\/span>Permission Prompts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>One of Deno\u2019s primary aims is offering a more secure JavaScript environment than alternatives like Node.js provide. Its strict permissions model prevents programs from accessing capabilities such as the network, filesystem, and host environment unless the user explicitly grants access.<\/p>\n<p>In previous Deno versions you needed to supply command-line flags such as <code>--allow-net<\/code> (permit networking) and <code>--allow-read<\/code> (allow filesystem reads) to grant these permissions. The <code>--prompt<\/code> flag was offered as an alternative, enumerating each permission as an interactive CLI prompt for you to answer <code>y<\/code> or <code>n<\/code> to.<\/p>\n<p>In Deno v1.19 the <code>--prompt<\/code> flag is <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/deno.com\/blog\/v1.19#permission-prompt-by-default\">automatically included<\/a> when you omit specific <code>--allow-<\/code> options. This makes it quicker to start applications that need several permissions. You don\u2019t need to remember them individually or specify <code>--prompt<\/code> each time.<\/p>\n<p>You can use the <code>--no-prompt<\/code> flag to disable interactive permission prompts altogether. This remains the default mode when Deno\u2019s running without a TTY.<\/p>\n<h2 id=\"native-web-streams\"><span class=\"ez-toc-section\" id=\"Native_Web_Streams\"><\/span>Native Web Streams<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Deno now uses <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Streams_API\">native <code>ReadableStream<\/code> and <code>WritableStream<\/code><\/a> instances for its file, networking, and stdio streams. The adoption of web streams for these functions improves interoperability between APIs and other runtimes such as web browsers. As an example, you can now stream network data straight to a file or standard output:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"javascript\">\n<pre class=\"de1\"><span class=\"kw1\">const<\/span> file <span class=\"sy0\">=<\/span> await Deno.<span class=\"me1\">create<\/span><span class=\"br0\">(<\/span><span class=\"st0\">\".\/data.txt\"<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw1\">const<\/span> networkResponse <span class=\"sy0\">=<\/span> await fetch<span class=\"br0\">(<\/span><span class=\"st0\">\"https:\/\/example.com\/data.txt\"<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\nawait networkResponse.<span class=\"me1\">body<\/span>.<span class=\"me1\">pipeTo<\/span><span class=\"br0\">(<\/span>file.<span class=\"me1\">writable<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Each stream\u2019s <code>readable<\/code> and <code>writable<\/code> properties refer to web stream instances. These can be freely passed between the supporting APIs, making complex asynchronous code clear and readable. The use of web streams extends to Deno\u2019s server component, letting you pipe streamed data into your HTTP responses.<\/p>\n<h2 id=\"simple-stream-compression\"><span class=\"ez-toc-section\" id=\"Simple_Stream_Compression\"><\/span>Simple Stream Compression<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Streams have also gained two new transformers, <code>CompressionStream<\/code> and <code>DecompressionStream<\/code>. These simplify the compression and decompression of data passing through streams. Deno\u2019s implemented the standardized APIs that already work in <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/caniuse.com\/?search=compressionstream\">Chrome and Opera<\/a>. Other browsers are expected to add support in the future.<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"javascript\">\n<pre class=\"de1\"><span class=\"kw1\">const<\/span> decompressed <span class=\"sy0\">=<\/span> await Deno.<span class=\"me1\">open<\/span><span class=\"br0\">(<\/span><span class=\"st0\">\".\/file.txt\"<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\n<span class=\"kw1\">const<\/span> compressed <span class=\"sy0\">=<\/span> await Deno.<span class=\"me1\">open<\/span><span class=\"br0\">(<\/span><span class=\"st0\">\".\/file.txt.gz\"<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span>\nawait decompressed.<span class=\"me1\">readable<\/span>\n    .<span class=\"me1\">pipeThrough<\/span><span class=\"br0\">(<\/span><span class=\"kw1\">new<\/span> CompressionStream<span class=\"br0\">(<\/span><span class=\"st0\">\"gz\"<\/span><span class=\"br0\">)<\/span><span class=\"br0\">)<\/span>\n    .<span class=\"me1\">pipeTo<\/span><span class=\"br0\">(<\/span>compressed.<span class=\"me1\">writable<\/span><span class=\"br0\">)<\/span><span class=\"sy0\">;<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>The transformers currently support <code>gzip<\/code> and <code>deflate<\/code>-formatted data. There\u2019s an open community <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/WICG\/compression\/issues\/34\">proposal<\/a> to extend the API with <code>brotli<\/code> compression too.<\/p>\n<h2 id=\"vendored-dependencies\"><span class=\"ez-toc-section\" id=\"Vendored_Dependencies\"><\/span>Vendored Dependencies<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A big new feature of the release is vendored dependencies. Deno now provides a mechanism for vendoring dependencies as part of your own source code. It removes the messy workaround of committing <code>DENO_DIR<\/code> to your repository just so you can make changes to files provided by external modules.<\/p>\n<p>Vendored dependencies give Deno something similar to Node.js\u2019 <code>node_modules<\/code> directory. Vendoring a module converts the opaque files in <code>DENO_DIR<\/code> into an on-disk dependency tree where filenames resemble original module names.<\/p>\n<p>The new <code>deno vendor<\/code> command downloads the remote dependencies of specified modules into a local <code>vendor<\/code> directory:<\/p>\n<pre>deno vendor main.ts<\/pre>\n<p>The directory will include an <code>import_map.json<\/code> that you can pass to Deno\u2019s <code>--import-map<\/code> flag when you execute your source. This will instruct Deno to resolve dependencies using the downloaded modules. Adding the <code>--no-remote<\/code> flag disables remote module loading altogether, guaranteeing the vendored dependencies will be used without exception.<\/p>\n<pre>deno run --no-remote --import-map=vendor\/import_map.json main.ts<\/pre>\n<p>A good use case for this feature is when you want to distribute vendored code alongside your own source. It\u2019s also handy for debugging when you need to inject some logging statements into a dependency. You can vendor the target module to conveniently browse and edit its source files. Once you\u2019re done, remove the <code>vendor<\/code> directory to revert to the regular module loading system.<\/p>\n<h2 id=\"improved-development-experience\"><span class=\"ez-toc-section\" id=\"Improved_Development_Experience\"><\/span>Improved Development Experience<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Other new improvements enhance the developer experience and Deno\u2019s debugging tools. Here are some of the changes you can benefit from:<\/p>\n<ul>\n<li><strong>More reliable compilation<\/strong> \u2013 The <code>deno compile<\/code> command serializes your dependency graph directly into the final binary. This removes the bundling step used in older Deno versions, ensuring code execution order remains correct. Compiled binaries should behave more predictably and be consistent with <code>deno run<\/code>.<\/li>\n<li><strong>Circular references in <code>console.log<\/code><\/strong> \u2013 Objects containing circular references are now clearly displayed in <code>console.log<\/code> output. Each reference includes an indicator of the target object and the circle count of the current iteration.<\/li>\n<li><strong>Easily save coverage reports<\/strong> \u2013 The <code>deno coverage<\/code> report has gained an <code>--output<\/code> flag that can be used to send output straight to a file (<code>deno coverage --lcov --output=coverage.lcov coverage\/<\/code>). Previously you needed to use shell redirection to manually pipe the command\u2019s standard output into files.<\/li>\n<li><strong>Disable file watcher console clears<\/strong> \u2013 Deno\u2019s <code>--watch<\/code> flag used to clear the console each time it restarted the running process. This behavior can now be disabled with the <code>--no-clear-screen<\/code> flag. It lets you retain console output after files are changed.<\/li>\n<li><strong>Reduced ambiguity in the <code>Deno.File<\/code> API<\/strong> \u2013 <code>Deno.File<\/code> is now <code>Deno.FsFile<\/code> to avoid confusion with the standardized <code>File<\/code> web API. You should update <code>Deno.File<\/code> references to the new variant to make it explicit that you\u2019re accessing local filesystem resources. <code>Deno.File<\/code> remains usable with deprecation warnings until Deno v2.<\/li>\n<\/ul>\n<p>There are also new unstable APIs to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/deno.com\/blog\/v1.19#new-unstable-api-denogetuid\">get the system user ID<\/a> of the running process and <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/deno.com\/blog\/v1.19#new-unstable-api-denonetworkinterfaces\">discover available network interfaces<\/a>. The existing unstable Unix sockets API can now be used to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/deno.com\/blog\/v1.19#serve-http-over-unix-sockets\">serve HTTP content<\/a>. Finally, the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/deno.com\/blog\/v1.19#stabilization-of-signal-listener-apis\">signal listeners API<\/a> for subscribing to system signals like <code>SIGINT<\/code> and <code>SIGTERM<\/code> has been promoted to stable status.<\/p>\n<h2 id=\"upgrading\"><span class=\"ez-toc-section\" id=\"Upgrading\"><\/span>Upgrading<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can upgrade to the new release by running the <code>deno upgrade<\/code> command. This will automatically download the latest version, unzip it, and overwrite your current Deno installation. You can rollback to v1.18 if you need to using <code>deno upgrade --version 1.18.2<\/code>.<\/p>\n<h2 id=\"summary\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Deno v1.19 is another healthy release for the JavaScript and TypeScript runtime. It streamlines several aspects of the development experience ranging from stream handling to the <code>deno<\/code> command-line utilities.<\/p>\n<p>The release also bumps the V8 runtime up to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/v8.dev\/blog\/v8-release-99\">9.9<\/a>. This adds new internalization features including more properties on the <code>Intl.Locale<\/code> object and an <code>Intel.supportedValuesOf()<\/code> function to check whether specific components are available. You can now use these capabilities in your Deno programs.\n<\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/15806\/whats-new-in-deno-1-19\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;What\u2019s New In Deno 1.19? \u2013 CloudSavvy IT&#8221; Deno 1.19 was released in February 2022 as the latest incremental update for the secure-by-design JavaScript runtime. Among the changes are a streamlined permissions management experience, first-class support for vendored dependencies, and new native web streams for files, network sockets, and standard input and output. In this&#8230;<\/p>\n","protected":false},"author":1,"featured_media":419307,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/10\/47891d3f.jpg","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-419306","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/419306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=419306"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/419306\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/419307"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=419306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=419306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=419306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}