SlideShare a Scribd company logo
1 of 7
Introduction of Deno 1.0
By : Vishal Sharma (Node Js developer)
Deno is a new runtime for JavaScript and TypeScript .
Developed by Ryan Dahl - the creator of Node.js.
Since 2018, the creator of Node.js has been working on a new
JavaScript runtime called Deno that addresses some of the pain
points he had identified. Deno’s features include:
1. An improved security model
2. Decentralized package management
3. A standard library
4. Built in tooling
Deno 1.0 was just released. What better time to dive in? In this
post we’ll get started with Deno by building a small project.
What is Deno ?
Why we use Deno instead of Node
Deno aims to fix Node.js design mistakes and offers a new modern
development environment.
Deno is a new platform for writing applications using JavaScript and
TypeScript. Both platforms share the same philosophy – event-
driven architecture and asynchronous non-blocking tools to build
web servers and services. The author of Deno is Ryan Dahl, original
creator of Node.js. In 2018, he gave the famous talk “10 Things I
Regret About Node.js“ and announced his new project – Deno.
Deno aims to fix Node.js design mistakes and offers a new modern
development environment.
Both platforms serve the same purpose, but use different
mechanisms. Deno uses ES Modules as the default module system,
whereas Node.js uses CommonJS. External dependencies are loaded
using URLs, similar to browsers.
What are its main features?
Security (permissions)
Among the most important of Deno’s features is its focus on security.
As opposed to Node, Deno by default executes the code in a sandbox, which means that
runtime has no access to:
1. The file system
2. The network
3. Execution of other scripts
4. The environment variables
Let’s take a look at how the permission system works.
(async () => {
const encoder = new TextEncoder();
const data = encoder.encode('Hello worldn');
await Deno.writeFile('hello.txt', data);
await Deno.writeFile('hello2.txt', data);
})();
When we run it by executing:
deno run write-hello.ts
Modules
Deno, just like browsers, loads modules by URLs. Many people got confused at first when they saw an
import statement with a URL on the server side, but it actually makes sense — just bear with me:
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
What’s the big deal with importing packages by their URLs, you may ask? The answer is simple: by
using URLs, Deno packages can be distributed without a centralized registry such as npm, which
recently has had a lot of problems, all of them explained
By importing code via URL, we make it possible for package creators to host their code wherever they
see fit — decentralization at its finest.
No more package.json and node_modules.
Do I have to import it by the URL all the time?
Constantly typing URLs would be very tedious. Thankfully, Deno presents us with two options to avoid
doing that.
The first option is to re-export the imported module from a local file, like so:
export { test, assertEquals } from "https://deno.land/std/testing/mod.ts";
Let’s say the file above is called local-test-utils.ts. Now, if we want to again make use of
either test or assertEquals functions, we can just reference it like this:
import { test, assertEquals } from './local-test-utils.ts';So it doesn’t really matter if it’s loaded from a
URL or not
Browser compatibility
Deno aims to be browser-compatible. Technically speaking, when using the ES modules,
we don’t have to use any build tools like webpack to make our application ready to use in a
browser.
However, tools like Babel will transpile the code to the ES5 version of JavaScript, and as a
result, the code can be run even in older browsers that don’t support all the newest
features of the language. But that also comes at the price of including a lot of unnecessary
code in the final file and bloating the output file.
It is up to us to decide what our main goal is and choose accordingly.
TypeScript support out of the box
Deno makes it easy to use TypeScript without the need for any config files. Still, it is
possible to write programs in plain JavaScript and execute them with Deno without any
trouble.
Summary
Deno, the new runtime for TypeScript and JavaScript, is an interesting project that
has been steadily growing for quite some time now. But it still has a long way to go
before it’s considered production-ready.
With it’s decentralized approach, it takes the necessary step of freeing the
JavaScript ecosystem from the centralized package registry that is npm.
Dahl says that he expects to release version 1.0 by the end of the summer, so if you
are interested in Deno’s future developments, star its repository.
Reference :
https://blog.logrocket.com/what-is-deno/
https://www.twilio.com/blog/getting-started-deno

More Related Content

What's hot

Node.js - Introduction and role in Frontend Development
Node.js - Introduction and role in Frontend DevelopmentNode.js - Introduction and role in Frontend Development
Node.js - Introduction and role in Frontend DevelopmentJulián David Duque
 
Introduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.jsIntroduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.jsSuroor Wijdan
 
Node JS Crash Course
Node JS Crash CourseNode JS Crash Course
Node JS Crash CourseHaim Michael
 
Getting Started With PowerShell Scripting
Getting Started With PowerShell ScriptingGetting Started With PowerShell Scripting
Getting Started With PowerShell ScriptingRavikanth Chaganti
 
Ceph Day Beijing: Ceph-Dokan: A Native Windows Ceph Client
Ceph Day Beijing: Ceph-Dokan: A Native Windows Ceph Client Ceph Day Beijing: Ceph-Dokan: A Native Windows Ceph Client
Ceph Day Beijing: Ceph-Dokan: A Native Windows Ceph Client Ceph Community
 
Node js - Enterprise Class
Node js - Enterprise ClassNode js - Enterprise Class
Node js - Enterprise ClassGlenn Block
 
Generating Visual Studio Code Extensions for Xtext DSLs
Generating Visual Studio Code Extensions for Xtext DSLsGenerating Visual Studio Code Extensions for Xtext DSLs
Generating Visual Studio Code Extensions for Xtext DSLsKarsten Thoms
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginnersEnoch Joshua
 
The Ring programming language version 1.2 book - Part 7 of 84
The Ring programming language version 1.2 book - Part 7 of 84The Ring programming language version 1.2 book - Part 7 of 84
The Ring programming language version 1.2 book - Part 7 of 84Mahmoud Samir Fayed
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsMichael Lange
 
Install Project INK
Install Project INKInstall Project INK
Install Project INKIshanJoshi36
 

What's hot (20)

Node.js - Introduction and role in Frontend Development
Node.js - Introduction and role in Frontend DevelopmentNode.js - Introduction and role in Frontend Development
Node.js - Introduction and role in Frontend Development
 
Introduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.jsIntroduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.js
 
Best node js course
Best node js courseBest node js course
Best node js course
 
Node JS Crash Course
Node JS Crash CourseNode JS Crash Course
Node JS Crash Course
 
Nodejs
NodejsNodejs
Nodejs
 
Getting Started With PowerShell Scripting
Getting Started With PowerShell ScriptingGetting Started With PowerShell Scripting
Getting Started With PowerShell Scripting
 
Ceph Day Beijing: Ceph-Dokan: A Native Windows Ceph Client
Ceph Day Beijing: Ceph-Dokan: A Native Windows Ceph Client Ceph Day Beijing: Ceph-Dokan: A Native Windows Ceph Client
Ceph Day Beijing: Ceph-Dokan: A Native Windows Ceph Client
 
Node js
Node jsNode js
Node js
 
Node js - Enterprise Class
Node js - Enterprise ClassNode js - Enterprise Class
Node js - Enterprise Class
 
Generating Visual Studio Code Extensions for Xtext DSLs
Generating Visual Studio Code Extensions for Xtext DSLsGenerating Visual Studio Code Extensions for Xtext DSLs
Generating Visual Studio Code Extensions for Xtext DSLs
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 
The Ring programming language version 1.2 book - Part 7 of 84
The Ring programming language version 1.2 book - Part 7 of 84The Ring programming language version 1.2 book - Part 7 of 84
The Ring programming language version 1.2 book - Part 7 of 84
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
 
Build a chatroom!
Build a chatroom!Build a chatroom!
Build a chatroom!
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
Nodejs vatsal shah
Nodejs vatsal shahNodejs vatsal shah
Nodejs vatsal shah
 
Nodejs basics
Nodejs basicsNodejs basics
Nodejs basics
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Meteor Introduction
Meteor IntroductionMeteor Introduction
Meteor Introduction
 
Install Project INK
Install Project INKInstall Project INK
Install Project INK
 

Similar to Introduction of deno 1

JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScript
JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScriptJS Fest 2019. Ryan Dahl. Deno, a new way to JavaScript
JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScriptJSFestUA
 
Node.js Web Development .pdf
Node.js Web Development .pdfNode.js Web Development .pdf
Node.js Web Development .pdfAbanti Aazmin
 
Unity Loves HelNode - Helsinki Node.js November Meetup
Unity Loves HelNode - Helsinki Node.js November MeetupUnity Loves HelNode - Helsinki Node.js November Meetup
Unity Loves HelNode - Helsinki Node.js November MeetupHelsinki Node.js Meetup Group
 
Shipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSShipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSRoss Kukulinski
 
8 good reasons to learn docker
8 good reasons to learn docker8 good reasons to learn docker
8 good reasons to learn dockerprabhasathya
 
GettingStartedWithDocker_docker
GettingStartedWithDocker_dockerGettingStartedWithDocker_docker
GettingStartedWithDocker_dockerHasibul Haque
 
DockerDay2015: Keynote
DockerDay2015: KeynoteDockerDay2015: Keynote
DockerDay2015: KeynoteDocker-Hanoi
 
node_js.pptx
node_js.pptxnode_js.pptx
node_js.pptxdipen55
 
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous  Blocking or synchronous.pdfNode Js Non-blocking or asynchronous  Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous Blocking or synchronous.pdfDarshanaMallick
 
The world of Docker and Kubernetes
The world of Docker and Kubernetes The world of Docker and Kubernetes
The world of Docker and Kubernetes vty
 
Node.js and .NET Core.pdf
Node.js and .NET Core.pdfNode.js and .NET Core.pdf
Node.js and .NET Core.pdfAppdeveloper10
 
Steps to Install NPM and Node.js on Windows and MAC
Steps to Install NPM and Node.js on Windows and MACSteps to Install NPM and Node.js on Windows and MAC
Steps to Install NPM and Node.js on Windows and MACInexture Solutions
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdflubnayasminsebl
 
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersDocker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersAnthony Chu
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Simon Storm
 

Similar to Introduction of deno 1 (20)

Nodejs
NodejsNodejs
Nodejs
 
JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScript
JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScriptJS Fest 2019. Ryan Dahl. Deno, a new way to JavaScript
JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScript
 
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
 
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
 
Node.js Web Development .pdf
Node.js Web Development .pdfNode.js Web Development .pdf
Node.js Web Development .pdf
 
Unity Loves HelNode - Helsinki Node.js November Meetup
Unity Loves HelNode - Helsinki Node.js November MeetupUnity Loves HelNode - Helsinki Node.js November Meetup
Unity Loves HelNode - Helsinki Node.js November Meetup
 
Shipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSShipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOS
 
8 good reasons to learn docker
8 good reasons to learn docker8 good reasons to learn docker
8 good reasons to learn docker
 
GettingStartedWithDocker_docker
GettingStartedWithDocker_dockerGettingStartedWithDocker_docker
GettingStartedWithDocker_docker
 
DockerDay2015: Keynote
DockerDay2015: KeynoteDockerDay2015: Keynote
DockerDay2015: Keynote
 
node_js.pptx
node_js.pptxnode_js.pptx
node_js.pptx
 
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous  Blocking or synchronous.pdfNode Js Non-blocking or asynchronous  Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
 
The world of Docker and Kubernetes
The world of Docker and Kubernetes The world of Docker and Kubernetes
The world of Docker and Kubernetes
 
Node.js and .NET Core.pdf
Node.js and .NET Core.pdfNode.js and .NET Core.pdf
Node.js and .NET Core.pdf
 
Steps to Install NPM and Node.js on Windows and MAC
Steps to Install NPM and Node.js on Windows and MACSteps to Install NPM and Node.js on Windows and MAC
Steps to Install NPM and Node.js on Windows and MAC
 
.Net Core
.Net Core.Net Core
.Net Core
 
Netbeans
NetbeansNetbeans
Netbeans
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
 
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersDocker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server Containers
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
 

Recently uploaded

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

Introduction of deno 1

  • 1. Introduction of Deno 1.0 By : Vishal Sharma (Node Js developer)
  • 2. Deno is a new runtime for JavaScript and TypeScript . Developed by Ryan Dahl - the creator of Node.js. Since 2018, the creator of Node.js has been working on a new JavaScript runtime called Deno that addresses some of the pain points he had identified. Deno’s features include: 1. An improved security model 2. Decentralized package management 3. A standard library 4. Built in tooling Deno 1.0 was just released. What better time to dive in? In this post we’ll get started with Deno by building a small project. What is Deno ?
  • 3. Why we use Deno instead of Node Deno aims to fix Node.js design mistakes and offers a new modern development environment. Deno is a new platform for writing applications using JavaScript and TypeScript. Both platforms share the same philosophy – event- driven architecture and asynchronous non-blocking tools to build web servers and services. The author of Deno is Ryan Dahl, original creator of Node.js. In 2018, he gave the famous talk “10 Things I Regret About Node.js“ and announced his new project – Deno. Deno aims to fix Node.js design mistakes and offers a new modern development environment. Both platforms serve the same purpose, but use different mechanisms. Deno uses ES Modules as the default module system, whereas Node.js uses CommonJS. External dependencies are loaded using URLs, similar to browsers.
  • 4. What are its main features? Security (permissions) Among the most important of Deno’s features is its focus on security. As opposed to Node, Deno by default executes the code in a sandbox, which means that runtime has no access to: 1. The file system 2. The network 3. Execution of other scripts 4. The environment variables Let’s take a look at how the permission system works. (async () => { const encoder = new TextEncoder(); const data = encoder.encode('Hello worldn'); await Deno.writeFile('hello.txt', data); await Deno.writeFile('hello2.txt', data); })(); When we run it by executing: deno run write-hello.ts
  • 5. Modules Deno, just like browsers, loads modules by URLs. Many people got confused at first when they saw an import statement with a URL on the server side, but it actually makes sense — just bear with me: import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; What’s the big deal with importing packages by their URLs, you may ask? The answer is simple: by using URLs, Deno packages can be distributed without a centralized registry such as npm, which recently has had a lot of problems, all of them explained By importing code via URL, we make it possible for package creators to host their code wherever they see fit — decentralization at its finest. No more package.json and node_modules. Do I have to import it by the URL all the time? Constantly typing URLs would be very tedious. Thankfully, Deno presents us with two options to avoid doing that. The first option is to re-export the imported module from a local file, like so: export { test, assertEquals } from "https://deno.land/std/testing/mod.ts"; Let’s say the file above is called local-test-utils.ts. Now, if we want to again make use of either test or assertEquals functions, we can just reference it like this: import { test, assertEquals } from './local-test-utils.ts';So it doesn’t really matter if it’s loaded from a URL or not
  • 6. Browser compatibility Deno aims to be browser-compatible. Technically speaking, when using the ES modules, we don’t have to use any build tools like webpack to make our application ready to use in a browser. However, tools like Babel will transpile the code to the ES5 version of JavaScript, and as a result, the code can be run even in older browsers that don’t support all the newest features of the language. But that also comes at the price of including a lot of unnecessary code in the final file and bloating the output file. It is up to us to decide what our main goal is and choose accordingly. TypeScript support out of the box Deno makes it easy to use TypeScript without the need for any config files. Still, it is possible to write programs in plain JavaScript and execute them with Deno without any trouble.
  • 7. Summary Deno, the new runtime for TypeScript and JavaScript, is an interesting project that has been steadily growing for quite some time now. But it still has a long way to go before it’s considered production-ready. With it’s decentralized approach, it takes the necessary step of freeing the JavaScript ecosystem from the centralized package registry that is npm. Dahl says that he expects to release version 1.0 by the end of the summer, so if you are interested in Deno’s future developments, star its repository. Reference : https://blog.logrocket.com/what-is-deno/ https://www.twilio.com/blog/getting-started-deno