🤠 Introduction It all started 2 years ago, Ryan Dahl, the creator of Node.js gave a talk at the JSConf 2018 "10 Things I Regret About Node.js" It was actually 7 things 🙃he regrets about Node.js: 1. he added them in June 2009 but removed them in February 2010, with Promises in Node.js, It could have sped up the delivery of a standard on async/await Not sticking with Promises: 2. Node process has wide access including system calls, network, disk I/O Security: 3. You need GYP for compiling native C library and link it to Node.js modules, Chrome used to use GYB but now Node is the sole user The build system: 4. it includes unnecessary information such as LICENCES and repository - also it uses a centralized repository for modules package.json: 5. maybe the worse for him, resolution is complex, folder size is frequently huge... node_modules: 6. the module load has to guess the extension and this is not how browser works require without extension: 7. it complicates the module loading system index.js: 🌈 Deno was born With all the things learned by building Node.js, Ryan came up with a new idea named [Deno](https://deno.land/): A secure runtime for JavaScript and TypeScript. Deno aims to provide a productive and secure scripting environment for the modern programmer. It is built on top of V8, Rust, and TypeScript. Instead of using C++ as in Node.js, It's built on top of and It uses under the hood.It brings many of the best open-source technologies together. Rust Tokio 🎉 Deno 1.0 - Release scheduled on May 13 So after almost 2 years, the API has been officially frozen and the launch of the 1.0 is scheduled on May 13. It addresses the design flaws that Ryan talked about in his lecture. Getting started 🙌 To install Deno, here are the instructions: Using Shell: bashcurl -fsSL https://deno.land/x/install/install.sh | sh Or using PowerShell: iwr https://deno.land/x/install/install.ps1 -useb | iex Using Homebrew (macOS or Linux): brew install deno Using Chocolatey (Windows): choco install deno See for more installation options. deno_install What's in the 1.0 release ? 👀 Deno 1.0 comes fully loaded with many useful features for modern development. In the following section we are going to cover all the greatest features coming in the new release. Supports TypeScript out of the box Well, everything is in the title. You can also bring your own by using the following command: tsconfig.json deno run -c tsconfig.json [program.ts] Security by design Programs run with no permissions and if the code needs permissions will be alerted. You need to use command-line options to tell Deno what permissions the program needs. by default By running you will see the full list of permissions. deno run -h ECMAScript modules built-in Deno does not support It uses ES Modules: require(), import * as log from "https://deno.land/std/log/mod.ts"; The package management is super simple, just provide the URL of what you want to use. As the URL may change, for security purposes, by using a lock file (using the --lock command line flag) you can ensure you're running the code you expect to be. Super simple package management Deno does not use npm. It uses modules referenced as URLs or file paths: { serve } ; s = serve({ : }); ( req s) { req.respond({ : }); } import from "https://deno.land/std@v0.42.0/http/server.ts" const port 8000 for await const of body "Hello World\n" You can specify version of the package in directly in the URL. For example . Also, Deno offers a built-in dependency inspector ( ). https://deno.land/std@v0.42.0/http/server.ts deno info Use `deps.ts` instead of `package.json` The Deno convention for dependency management is using a unique file called for storing all the dependency. For example, we can look at the of , the popular middleware framework for Deno's http server inspired by Koa: deps.ts deps.ts oak { HTTPOptions, HTTPSOptions, Response, serve, Server, ServerRequest, serveTLS, } ; { Status, STATUS_TEXT, } ; { Cookies, Cookie, setCookie, getCookies, delCookie, } ; { basename, extname, join, isAbsolute, normalize, parse, resolve, sep, } ; { HmacSha256 } ; { assert } ; { contentType, lookup, } ; // Copyright 2018-2020 the oak authors. All rights reserved. MIT license. // This file contains the external dependencies that oak depends upon export from "https://deno.land/std@v1.0.0-rc1/http/server.ts" export from "https://deno.land/std@v1.0.0-rc1/http/http_status.ts" export from "https://deno.land/std@v1.0.0-rc1/http/cookie.ts" export from "https://deno.land/std@v1.0.0-rc1/path/mod.ts" export from "https://deno.land/std@v1.0.0-rc1/util/sha256.ts" export from "https://deno.land/std@v1.0.0-rc1/testing/asserts.ts" export from "https://deno.land/x/media_types@v2.0.0/mod.ts" (Source: https://github.com/oakserver/oak/blob/master/deps.ts) JSDoc built-in with deno doc We strive for complete documentation. Deno has JSDoc built-in so you can use write JSDoc comments in files. Test runner with Deno.test() module provides range of assertion helpers: std/testing/asserts.ts equal() assert() assertEquals() assertNotEquals() assertStrictEq() assertStrContains() assertMatch() assertArrayContains() assertThrows() assertThrowsAsync() unimplemented() For example: unreachable() { assertEquals } ; Deno.test({ : , fn(): { assertEquals( , ); assertEquals({ : }, { : }); }, }); import from "https://deno.land/std/testing/asserts.ts" name "testing example" void "world" "world" hello "world" hello "world" (Source: https://github.com/denoland/deno/tree/master/std/testing) Run : deno test file.spec.ts Compile file.spec.ts Download https://deno.land/std/testing/asserts.ts Download https://deno.land/std/fmt/colors.ts Download https://deno.land/std/testing/diff.ts running 1 tests testing example ... ok (9ms) result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (9ms) test test Formatting with deno fmt <files> It is provided by , an alternative to the famour Prettier. dprint Compiling and bundling with deno bundle It is currently marked as unstable. So use it at your own risk. Debugger deno run -A --inspect-brk fileToDebug.ts With this you can open the Chrome debugger ( ) and start inspect the process! chrome://inspect Reviewed (audited) Standard library The standard library is garanteed to work with Deno, they do not have external dependencies and they are reviewed by the Deno core team. Modules are tagged in accordance with Deno releases, so version v0.4.0 of a standard library is garanteed to work with Deno v0.4.0. List of modules: colors datetime encoding examples flags fs http log node testing uuid ws Example: Build a simple HTTP Server using Deno 🚀` { Application } ; app = Application(); app.use( (ctx, next) => { next(); rt = ctx.response.headers.get( ); .log( ); }); app.use( { ctx.response.body = ; }); app.listen({ : }); import from "https://deno.land/x/oak/mod.ts" const new // Logger async await const "X-Response-Time" console ` - ` ${ctx.request.method} ${ctx.request.url} ${rt} // Hello World! ( ) => ctx "Hello World!" await port 8000 Let's run it using : deno server.ts Compile file:///.../server.ts Download https://deno.land/x/oak/mod.ts Download https://deno.land/x/oak/application.ts Download https://deno.land/x/oak/context.ts Download https://deno.land/x/oak/cookies.ts Download https://deno.land/x/oak/httpError.ts Download https://deno.land/x/oak/middleware.ts Download https://deno.land/x/oak/request.ts Download https://deno.land/x/oak/response.ts Download https://deno.land/x/oak/router.ts Download https://deno.land/x/oak/send.ts Download https://deno.land/x/oak/types.ts Download https://deno.land/x/oak/deps.ts Download https://deno.land/x/oak/keyStack.ts Download https://deno.land/x/oak/tssCompare.ts Download https://deno.land/std@v1.0.0-rc1/http/server.ts Download https://deno.land/std@v1.0.0-rc1/http/http_status.ts Download https://deno.land/std@v1.0.0-rc1/http/cookie.ts Download https://deno.land/std@v1.0.0-rc1/path/mod.ts Download https://deno.land/std@v1.0.0-rc1/util/sha256.ts Download https://deno.land/std@v1.0.0-rc1/testing/asserts.ts Download https://deno.land/x/media_types@v2.0.0/mod.ts Download https://deno.land/std@v1.0.0-rc1/encoding/utf8.ts Download https://deno.land/std@v1.0.0-rc1/io/bufio.ts Download https://deno.land/std@v1.0.0-rc1/util/async.ts Download https://deno.land/std@v1.0.0-rc1/http/io.ts Download https://deno.land/std@v1.0.0-rc1/io/util.ts Download https://deno.land/std@v1.0.0-rc1/path/win32.ts Download https://deno.land/std@v1.0.0-rc1/path/posix.ts Download https://deno.land/std@v1.0.0-rc1/path/constants.ts Download https://deno.land/std@v1.0.0-rc1/path/common.ts Download https://deno.land/std@v1.0.0-rc1/path/constants.ts Download https://deno.land/std@v1.0.0-rc1/path/interface.ts Download https://deno.land/std@v1.0.0-rc1/path/glob.ts Download https://deno.land/std@v1.0.0-rc1/path/globrex.ts Download https://deno.land/std@v1.0.0-rc1/path/utils.ts Download https://deno.land/std@v1.0.0-rc1/fmt/colors.ts Download https://deno.land/std@v1.0.0-rc1/testing/diff.ts Download https://deno.land/std@v1.0.0-rc1/textproto/mod.ts Download https://deno.land/std@v1.0.0-rc1/bytes/mod.ts Download https://deno.land/std@v1.0.0-rc1/datetime/mod.ts Download https://deno.land/x/media_types@v2.0.0/db.ts Download https://deno.land/x/media_types@v2.0.0/deps.ts Download https://deno.land/std@v0.42.0/path/mod.ts Download https://deno.land/std@v0.42.0/path/win32.ts Download https://deno.land/std@v0.42.0/path/posix.ts Download https://deno.land/std@v0.42.0/path/constants.ts Download https://deno.land/std@v0.42.0/path/common.ts Download https://deno.land/std@v0.42.0/path/constants.ts Download https://deno.land/std@v0.42.0/path/interface.ts Download https://deno.land/std@v0.42.0/path/glob.ts Download https://deno.land/std@v0.42.0/path/globrex.ts Download https://deno.land/std@v0.42.0/path/utils.ts Download https://deno.land/std@v0.42.0/testing/asserts.ts Download https://deno.land/std@v0.42.0/fmt/colors.ts Download https://deno.land/std@v0.42.0/testing/diff.ts Download https://deno.land/x/oak/encoding.ts Download https://deno.land/x/oak/isMediaType.ts Download https://deno.land/x/oak/mediaType.ts Download https://deno.land/x/oak/mediaTyper.ts Download https://deno.land/x/oak/util.ts Download https://deno.land/x/oak/pathToRegExp.ts error: Uncaught PermissionDenied: network access to , run again with the --allow-net flag at unwrapResponse ( $/ops/dispatch_json.ts:43:11) at Object.sendSync ( $/ops/dispatch_json.ts:72:10) at Object.listen ( $/ops/net.ts:51:10) at listen ( $/net.ts:164:18) at Application.serve (server.ts:261:20) at Application.listen (application.ts:106:31) at server.ts:18:11 "127.0.0.1:8000" $deno $deno $deno $deno Let's add the missing permission : deno --allow-net server.ts $ curl http://127.0.0.1:8000 Hello World! You are now ready for the upcoming release of Deno 1.0 - Stay tuned 😍 Please leave me comment if you've liked this article! You can also follow me on Twitter 🙌 @loverdeolivier This article was originally posted on my blog olivier.codes