Deno Çalışma Zamanı Temel Bilgileri
Deno'nun temel özelliklerini ve yerleşik araçlarını, Node.js'ten farklarıyla birlikte keşfedin.
Deno Çalışma Zamanı Temel Bilgileri, CoddyKit'te ücretsiz bir Edge Computing with Cloudflare Workers & Deno dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Edge Computing with Cloudflare Workers & Deno öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Edge Computing with Cloudflare Workers & Deno kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
Welcome to Deno Essentials
Welcome! In this lesson, we'll dive into Deno, a modern, secure runtime for JavaScript and TypeScript.
Created by Ryan Dahl (who also created Node.js), Deno addresses some of the design choices made in Node.js, focusing on security and a great developer experience.
Security First: Deno's Approach
One of Deno's biggest differences is its security model. By default, Deno scripts run in a sandbox, meaning they have no access to:
- The file system
- The network
- Environment variables
- Subprocesses
You must explicitly grant these permissions using command-line flags. This prevents malicious code from doing harm without your knowledge.
Built-in Tooling
Deno comes with a powerful set of built-in tools. Forget installing separate packages for formatting, linting, or testing!
Key tools include:
deno fmt: Code formatterdeno lint: Linter for code qualitydeno test: Test runnerdeno doc: Documentation generatordeno compile: Compiles scripts into self-contained executables
This integrated experience simplifies project setup and maintenance.
Native TypeScript Support
Deno supports TypeScript out of the box. This means you can write TypeScript code without needing a separate compilation step or tsconfig.json file.
It also embraces ES Modules, allowing you to import modules directly from URLs, much like how browsers work. No more node_modules folder!
Your First Deno Program
Let's write a simple Deno program. Save this as hello.ts (or .js) and run it with deno run hello.ts.
console.log("Hello from Deno!");
console.log("Deno is awesome.");Deno vs. Node.js: Core Differences
While both Deno and Node.js are JavaScript runtimes, they have fundamental differences:
- Security: Deno is secure by default (permissions needed), Node.js has full access.
- TypeScript: Deno supports TS natively, Node.js requires transpilation.
- Tooling: Deno has built-in tools (fmt, lint, test), Node.js relies on npm packages.
- Module System: Deno uses URL-based ES Modules, Node.js uses CommonJS (though ES Modules are gaining traction).
- Standard Library: Deno has a robust standard library, Node.js has a smaller core.
The Global Deno Object
Deno exposes a global Deno object that provides access to runtime-specific APIs, like file system operations, network access, and environment variables.
Here's how you can access command-line arguments passed to your script:
console.log("Arguments:", Deno.args);
// Try running: deno run my_script.ts arg1 arg2Running with Permissions
To demonstrate Deno's permission model, let's try to read a file. This script will fail without explicit permission.
To run it successfully, you'll need to add the --allow-read flag: deno run --allow-read file_reader.ts
try {
const content = Deno.readTextFileSync("data.txt");
console.log("File content:\n" + content);
} catch (error) {
console.error("Error reading file: ", error.message);
console.error("Hint: Try 'deno run --allow-read file_reader.ts'");
}Deno Essentials Check
Which of the following statements about Deno is TRUE?
Recap: Deno's Foundation
Great job! In this lesson, you've learned about Deno's foundational features:
- Its security-first approach with a granular permission model.
- The convenience of its built-in tooling.
- Native TypeScript and ES Module support.
- The global
Denoobject for runtime interactions.
These essentials make Deno a powerful and modern runtime for web development, especially at the edge!
Sıkça Sorulan Sorular
“Deno Çalışma Zamanı Temel Bilgileri” dersi ücretsiz mi?
Evet — “Deno Çalışma Zamanı Temel Bilgileri” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Edge Computing with Cloudflare Workers & Deno kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Edge Computing with Cloudflare Workers & Deno kursu toplamda 4 dersten oluşur.
“Deno Çalışma Zamanı Temel Bilgileri” dersinde ne öğreneceğim?
Deno'nun temel özelliklerini ve yerleşik araçlarını, Node.js'ten farklarıyla birlikte keşfedin. Edge Computing with Cloudflare Workers & Deno ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Edge Computing with Cloudflare Workers & Deno öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Edge Computing with Cloudflare Workers & Deno, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.
“Deno Çalışma Zamanı Temel Bilgileri” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Edge Computing with Cloudflare Workers & Deno dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Edge Computing with Cloudflare Workers & Deno dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Deno Çalışma Zamanı Temel Bilgileri
- Modül Sistemi ve İzinler
- Yerel Deno Uygulamaları Geliştirme
- Deno Uygulamalarını Sınama