📅  最后修改于: 2023-12-03 15:28:17.274000             🧑  作者: Mango
Deno is a secure runtime for JavaScript/TypeScript. It was created by the original creator of Node.js, Ryan Dahl, with the goal of fixing some of the issues that have been present in Node.js since its inception.
fetch
, WebSocket
and WebSockets
.To get started with Deno and TypeScript, you'll need to have them both installed on your machine. Here's how you can do that:
npm install -g typescript
.Once you have Deno and TypeScript installed, you can create a new TypeScript file by running:
touch main.ts
Then, open the file in your favorite text editor and add the following code:
console.log('Hello, world!');
To run the code, simply execute the following command in your terminal:
deno run main.ts
You should see Hello, world!
printed to your terminal.
Deno is an exciting new runtime for JavaScript/TypeScript that offers a number of features that Node.js doesn't have. If you're interested in learning more, check out the Deno documentation.