├── 404 └── index.mdx ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .github └── workflows │ ├── better_link_checker.ts │ ├── ci.yml │ ├── deploy.yml │ ├── update_versions.ts │ └── update_versions.yml ├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── _components ├── Admonition.tsx ├── Banner.css ├── Banner.tsx ├── Base.tsx ├── Breadcrumbs.css ├── Breadcrumbs.tsx ├── CTA.css ├── CTA.tsx ├── Columns.css ├── Columns.tsx ├── ExternalLink.css ├── ExternalLink.tsx ├── Feedback.tsx ├── Footer.css ├── Footer.tsx ├── FourOhFour.css ├── FourOhFour.tsx ├── Hamburger.css ├── Hamburger.tsx ├── Header.css ├── Header.tsx ├── HeaderAnchor.tsx ├── Heading.css ├── Heading.tsx ├── Hero.css ├── Hero.tsx ├── LandingPage.tsx ├── Logo.tsx ├── MainNav.css ├── MainNav.tsx ├── Navigation.css ├── Navigation.tsx ├── NavigationButton.tsx ├── OpenGraph.tsx ├── RefHeader.css ├── RefHeader.tsx ├── RefToc.tsx ├── SearchInput.css ├── SearchInput.tsx ├── SecondaryNav.css ├── SecondaryNav.tsx ├── Sidebar.tsx ├── SubNav.tsx ├── TabItem.tsx ├── TableOfContents.css ├── TableOfContents.tsx ├── TableOfContentsItem.tsx ├── TableOfContentsMobile.tsx ├── Tabs.tsx ├── ThemeToggle.css ├── ThemeToggle.tsx ├── ToTop.tsx ├── VideoPlayer.css └── VideoPlayer.tsx ├── _config-styleguide.ts ├── _config.ts ├── _data.json ├── _includes ├── doc.tsx ├── layout.tsx ├── lintRule.tsx ├── open_graph │ ├── cli-commands.jsx │ ├── default.jsx │ └── examples.jsx ├── raw.tsx ├── reference │ ├── allSymbols.tsx │ ├── index.tsx │ └── symbol.tsx ├── renderCommand.tsx └── video.tsx ├── copy.client.ts ├── data.json ├── deno.json ├── deno.lock ├── deploy ├── _data.ts ├── api │ ├── compression.md │ ├── dynamic-import.md │ ├── index.md │ ├── runtime-broadcast-channel.md │ ├── runtime-fetch.md │ ├── runtime-fs.md │ ├── runtime-headers.md │ ├── runtime-node.md │ ├── runtime-request.md │ ├── runtime-response.md │ └── runtime-sockets.md ├── docs-images │ ├── add_custom_domain.png │ ├── blank_project.png │ ├── change_dns_records.png │ ├── discord-slash-command.png │ ├── dns_records_modal.png │ ├── fauna1.png │ ├── fauna2.png │ ├── get_certificates.png │ ├── green_check.png │ ├── neon_postgres_env_variable.png │ ├── new_github_repo.png │ ├── organizations.png │ ├── postgres_env_variable.png │ ├── preview_deployment.png │ ├── project_name.png │ ├── promote_to_production.png │ ├── proxy_to_example.png │ ├── vite-branch.png │ ├── vite-deploy-yaml.png │ ├── vite-link.png │ ├── vite-ok.png │ └── vite-project.png ├── early-access │ ├── _data.ts │ ├── changelog.md │ ├── getting_started.md │ ├── images │ │ ├── app_config.png │ │ ├── build_config.png │ │ ├── build_logs.png │ │ ├── create_app.png │ │ ├── create_org.png │ │ ├── env_var.png │ │ ├── logs.png │ │ ├── select_org.png │ │ ├── trace.png │ │ └── traces.png │ ├── index.md │ ├── reference │ │ ├── accounts.md │ │ ├── apps.md │ │ ├── builds.md │ │ ├── caching.md │ │ ├── domains.md │ │ ├── env-vars-and-contexts.md │ │ ├── frameworks.md │ │ ├── index.md │ │ ├── observability.md │ │ ├── organizations.md │ │ ├── runtime.md │ │ └── timelines.md │ ├── support │ │ └── index.md │ └── usage.md ├── index.md ├── kv │ ├── manual │ │ ├── _admonition.tsx │ │ ├── backup.md │ │ ├── cron.md │ │ ├── data_modeling_typescript.md │ │ ├── images │ │ │ ├── backup-add-bucket-to-dash.png │ │ │ ├── backup-bucket-create.png │ │ │ ├── backup-gcs-bucket-create.png │ │ │ ├── backup-gcs-create-hmac.png │ │ │ ├── backup-gcs-grant.png │ │ │ ├── cron-tasks.png │ │ │ └── kv-connect.png │ │ ├── index.md │ │ ├── key_expiration.md │ │ ├── key_space.md │ │ ├── node.md │ │ ├── on_deploy.md │ │ ├── operations.md │ │ ├── queue_overview.md │ │ ├── secondary_indexes.md │ │ └── transactions.md │ └── tutorials │ │ ├── images │ │ └── github_webhook.png │ │ ├── index.md │ │ ├── schedule_notification.md │ │ └── webhook_processor.md ├── manual │ ├── acceptable-use-policy.md │ ├── ci_github.md │ ├── custom-domains.md │ ├── deployctl.md │ ├── deployments.md │ ├── dynamodb.md │ ├── edge-cache.md │ ├── environment-variables.md │ ├── faunadb.md │ ├── firebase.md │ ├── fulfillment-policy.md │ ├── how-to-deploy.md │ ├── images │ │ ├── deploy_onboarding.png │ │ ├── deployctl-deployments-list.png │ │ ├── deployctl-deployments-show.png │ │ └── project_deployments.png │ ├── index.md │ ├── logs.md │ ├── middleware.md │ ├── neon-postgres.md │ ├── organizations.md │ ├── playgrounds.md │ ├── postgres.md │ ├── pricing-and-limits.md │ ├── privacy-policy.md │ ├── regions.md │ ├── running-scripts-locally.md │ ├── security.md │ ├── terms-and-conditions.md │ └── use-cases.md └── tutorials │ ├── discord-slash.md │ ├── fresh.md │ ├── images │ ├── simple_api_dashboard.png │ ├── simple_api_deploy.png │ └── simple_api_deploy_settings.png │ ├── index.md │ ├── simple-api.md │ ├── static-site.md │ ├── tutorial-blog-fresh.md │ ├── tutorial-dynamodb.md │ ├── tutorial-faunadb.md │ ├── tutorial-firebase.md │ ├── tutorial-http-server.md │ ├── tutorial-hugo-blog.md │ ├── tutorial-postgres.md │ ├── tutorial-wordpress-frontend.md │ └── vite.md ├── examples ├── _components │ ├── CopyButton.tsx │ ├── EmbedVideo.tsx │ ├── ExampleIcon.tsx │ ├── ExamplePage.tsx │ ├── LearningList.tsx │ ├── SnippetComponent.tsx │ ├── TutorialIcon.tsx │ └── VideoIcon.tsx ├── _data.ts ├── _pages │ ├── VideoPage.tsx │ └── examples_test.ts ├── index.examples.tsx ├── index.tsx ├── scripts │ ├── aes_encryption.ts │ ├── benchmarking.ts │ ├── byte_manipulation.ts │ ├── checking_directory_existence.ts │ ├── checking_file_existence.ts │ ├── color_logging.ts │ ├── command_line_arguments.ts │ ├── create_remove_directories.ts │ ├── creating_and_verifying_jwt.ts │ ├── cron.ts │ ├── data_processing.ts │ ├── deleting_files.ts │ ├── deno_version.ts │ ├── dns_queries.ts │ ├── duckdb.ts │ ├── environment_variables.ts │ ├── exponential_backoff.ts │ ├── hashing.ts │ ├── hello_world.ts │ ├── hex_base64_encoding.ts │ ├── hmac_generate_verify.ts │ ├── hono.ts │ ├── http_requests.ts │ ├── http_server.ts │ ├── http_server_file_upload.ts │ ├── http_server_files.ts │ ├── http_server_oak_crud_middleware_with_sqlite3_db.ts │ ├── http_server_routing.ts │ ├── http_server_streaming.ts │ ├── http_server_websocket.ts │ ├── import_export.ts │ ├── importing_json.ts │ ├── kv.ts │ ├── kv_watch.ts │ ├── mongo.ts │ ├── moving_renaming_files.ts │ ├── node_built_in.ts │ ├── npm.ts │ ├── openai_chat_completion.ts │ ├── os_signals.ts │ ├── parsing_serializing_csv.ts │ ├── parsing_serializing_json.ts │ ├── parsing_serializing_toml.ts │ ├── parsing_serializing_yaml.ts │ ├── path_operations.ts │ ├── permissions.ts │ ├── pid.ts │ ├── piping_streams.ts │ ├── postgres.ts │ ├── prompts.ts │ ├── queues.ts │ ├── reading_files.ts │ ├── reading_system_metrics.ts │ ├── redis.ts │ ├── rsa_signature.ts │ ├── spy_functions.ts │ ├── sqlite.ts │ ├── sss.ts │ ├── streaming_files.ts │ ├── stubs.ts │ ├── subprocess_running_files.ts │ ├── subprocesses_output.ts │ ├── subprocesses_spawn.ts │ ├── supabase.ts │ ├── symlinks.ts │ ├── tcp_connector.ts │ ├── tcp_echo_server.ts │ ├── tcp_listener.ts │ ├── temporal.ts │ ├── temporary_files.ts │ ├── timers.ts │ ├── tls_connector.ts │ ├── tls_listener.ts │ ├── top_level_await.ts │ ├── typescript_support.ts │ ├── udp_connector.ts │ ├── udp_listener.ts │ ├── ulid.ts │ ├── unix_cat.ts │ ├── unzip_gzipped_file.ts │ ├── url_parsing.ts │ ├── uuids.ts │ ├── walking_directories.ts │ ├── watching_files.ts │ ├── web_workers.ts │ ├── webassembly.ts │ ├── websocket.ts │ ├── writing_files.ts │ └── writing_tests.ts ├── tutorials │ ├── apollo.md │ ├── astro.md │ ├── aws_lambda.md │ ├── aws_lightsail.md │ ├── bdd.md │ ├── chat_app.md │ ├── cjs_to_esm.md │ ├── cloudflare_workers.md │ ├── connecting_to_databases.md │ ├── create_react.md │ ├── debugging_with_console.md │ ├── digital_ocean.md │ ├── drizzle.md │ ├── express.md │ ├── fetch_data.md │ ├── file_based_routing.md │ ├── file_server.md │ ├── file_system_events.md │ ├── google_cloud_run.md │ ├── grafana.md │ ├── hashbang.md │ ├── honeycomb.md │ ├── hyperdx.md │ ├── images │ │ ├── deno-educator.png │ │ ├── how-to │ │ │ ├── astro │ │ │ │ ├── dynamic-page.webp │ │ │ │ ├── hello-astro.png │ │ │ │ └── index-page.webp │ │ │ ├── aws-lightsail │ │ │ │ ├── create-container-service-on-aws.png │ │ │ │ ├── hello-world-from-deno-and-aws-lightsail.png │ │ │ │ ├── hello-world-from-localhost.png │ │ │ │ └── new-image-on-docker-hub.png │ │ │ ├── cloudflare-workers │ │ │ │ └── main-on-cloudflare.png │ │ │ ├── digital-ocean │ │ │ │ ├── hello-from-deno-and-digital-ocean.png │ │ │ │ ├── hello-world-from-localhost.png │ │ │ │ └── new-deno-image-on-digital-ocean-container-registry.png │ │ │ ├── drizzle │ │ │ │ └── table-diagram.png │ │ │ ├── google-cloud-run │ │ │ │ ├── hello-from-google-cloud-run.png │ │ │ │ ├── hello-world-from-localhost.png │ │ │ │ ├── image-in-google-artifact-registry.png │ │ │ │ └── new-repository-in-google-artifact-repository.png │ │ │ ├── grafana │ │ │ │ ├── grafana-1.png │ │ │ │ ├── grafana-2.png │ │ │ │ ├── grafana-3.png │ │ │ │ ├── grafana-logs.png │ │ │ │ ├── grafana-traces.png │ │ │ │ └── propagation.png │ │ │ ├── honeycomb │ │ │ │ ├── honeycomb-1.webp │ │ │ │ ├── honeycomb-2.webp │ │ │ │ ├── honeycomb-3.webp │ │ │ │ └── honeycomb-4.webp │ │ │ ├── hyperdx │ │ │ │ ├── hyperdx-1.webp │ │ │ │ ├── hyperdx-2.webp │ │ │ │ ├── hyperdx-3.webp │ │ │ │ └── hyperdx-4.webp │ │ │ ├── next │ │ │ │ └── dinoapp.gif │ │ │ ├── nuxt │ │ │ │ ├── nuxt-1.webp │ │ │ │ ├── nuxt-2.webp │ │ │ │ ├── nuxt-3.mp4 │ │ │ │ └── nuxt-4.mp4 │ │ │ ├── prisma │ │ │ │ ├── 1-dinosaurs-in-prisma.png │ │ │ │ ├── 2-dinosaurs-from-api.png │ │ │ │ └── 3-new-dinosaur-in-prisma.png │ │ │ ├── qwik │ │ │ │ └── demo.mp4 │ │ │ ├── react │ │ │ │ └── react-dinosaur-app-demo.gif │ │ │ ├── redis │ │ │ │ ├── cached-redis-body.png │ │ │ │ ├── cached-redis-header.png │ │ │ │ ├── uncached-redis-body.png │ │ │ │ └── uncached-redis-header.png │ │ │ ├── solidjs │ │ │ │ └── demo.mp4 │ │ │ ├── tanstack │ │ │ │ └── demo.mp4 │ │ │ └── vue │ │ │ │ └── vue.gif │ │ ├── quick-fix.png │ │ ├── websockets.gif │ │ └── word_finder.png │ ├── initialize_project.md │ ├── kinsta.md │ ├── mocking.md │ ├── module_metadata.md │ ├── mongoose.md │ ├── mysql2.md │ ├── next.md │ ├── nuxt.md │ ├── os_signals.md │ ├── otel_span_propagation.md │ ├── planetscale.md │ ├── prisma.md │ ├── qwik.md │ ├── react.md │ ├── redis.md │ ├── run_script.md │ ├── snapshot.md │ ├── solidjs.md │ ├── subprocess.md │ ├── tanstack.md │ ├── testing.md │ ├── trpc.md │ ├── vue.md │ ├── web_testing.md │ └── word_finder.md ├── types.ts ├── utils │ └── parseExample.ts └── videos │ ├── all-in-one_tooling.md │ ├── backward_compat_with_node_npm.md │ ├── browser_apis_in_deno.md │ ├── build_api_server_ts.md │ ├── command_line_utility.md │ ├── configuration_with_deno_json.md │ ├── deno_bench.md │ ├── deno_coverage.md │ ├── deno_dev_environment.md │ ├── deno_fmt.md │ ├── deno_test.md │ ├── deploy_deno_to_aws_lambda.md │ ├── deploying_deno_with_docker.md │ ├── esmodules.md │ ├── interoperability_with_nodejs.md │ ├── intro_to_deno_apis.md │ ├── mongoose.md │ ├── prisma.md │ ├── publishing_modules_with_jsr.md │ ├── react_app_video.md │ ├── realtime_websocket_app.md │ ├── ts_jsx.md │ ├── vue_app_video.md │ └── what_is_deno.md ├── feedback.client.ts ├── generate_llms_files.ts ├── go.json ├── index.mdx ├── lint ├── _data.ts ├── index.tsx ├── lint_rule.page.tsx └── rules │ ├── adjacent-overload-signatures.md │ ├── ban-ts-comment.md │ ├── ban-types.md │ ├── ban-unknown-rule-code.md │ ├── ban-untagged-ignore.md │ ├── ban-untagged-todo.md │ ├── ban-unused-ignore.md │ ├── button-has-type.md │ ├── camelcase.md │ ├── constructor-super.md │ ├── default-param-last.md │ ├── eqeqeq.md │ ├── explicit-function-return-type.md │ ├── explicit-module-boundary-types.md │ ├── for-direction.md │ ├── fresh-handler-export.md │ ├── fresh-server-event-handlers.md │ ├── getter-return.md │ ├── guard-for-in.md │ ├── jsx-boolean-value.md │ ├── jsx-button-has-type.md │ ├── jsx-curly-braces.md │ ├── jsx-key.md │ ├── jsx-no-children-prop.md │ ├── jsx-no-comment-text-nodes.md │ ├── jsx-no-duplicate-props.md │ ├── jsx-no-unescaped-entities.md │ ├── jsx-no-useless-fragment.md │ ├── jsx-props-no-spread-multi.md │ ├── jsx-void-dom-elements-no-children.md │ ├── no-array-constructor.md │ ├── no-async-promise-executor.md │ ├── no-await-in-loop.md │ ├── no-await-in-sync-fn.md │ ├── no-boolean-literal-for-arguments.md │ ├── no-case-declarations.md │ ├── no-class-assign.md │ ├── no-compare-neg-zero.md │ ├── no-cond-assign.md │ ├── no-console.md │ ├── no-const-assign.md │ ├── no-constant-condition.md │ ├── no-control-regex.md │ ├── no-debugger.md │ ├── no-delete-var.md │ ├── no-deprecated-deno-api.md │ ├── no-dupe-args.md │ ├── no-dupe-class-members.md │ ├── no-dupe-else-if.md │ ├── no-dupe-keys.md │ ├── no-duplicate-case.md │ ├── no-empty-character-class.md │ ├── no-empty-enum.md │ ├── no-empty-interface.md │ ├── no-empty-pattern.md │ ├── no-empty.md │ ├── no-eval.md │ ├── no-ex-assign.md │ ├── no-explicit-any.md │ ├── no-external-import.md │ ├── no-extra-boolean-cast.md │ ├── no-extra-non-null-assertion.md │ ├── no-fallthrough.md │ ├── no-func-assign.md │ ├── no-global-assign.md │ ├── no-implicit-declare-namespace-export.md │ ├── no-import-assertions.md │ ├── no-import-assign.md │ ├── no-inferrable-types.md │ ├── no-inner-declarations.md │ ├── no-invalid-regexp.md │ ├── no-invalid-triple-slash-reference.md │ ├── no-irregular-whitespace.md │ ├── no-misused-new.md │ ├── no-namespace.md │ ├── no-new-symbol.md │ ├── no-node-globals.md │ ├── no-non-null-asserted-optional-chain.md │ ├── no-non-null-assertion.md │ ├── no-obj-calls.md │ ├── no-octal.md │ ├── no-process-global.md │ ├── no-prototype-builtins.md │ ├── no-redeclare.md │ ├── no-regex-spaces.md │ ├── no-self-assign.md │ ├── no-self-compare.md │ ├── no-setter-return.md │ ├── no-shadow-restricted-names.md │ ├── no-sloppy-imports.md │ ├── no-slow-types.md │ ├── no-sparse-arrays.md │ ├── no-sync-fn-in-async-fn.md │ ├── no-this-alias.md │ ├── no-this-before-super.md │ ├── no-throw-literal.md │ ├── no-top-level-await.md │ ├── no-undef.md │ ├── no-unreachable.md │ ├── no-unsafe-finally.md │ ├── no-unsafe-negation.md │ ├── no-unused-labels.md │ ├── no-unused-vars.md │ ├── no-useless-rename.md │ ├── no-var.md │ ├── no-window-prefix.md │ ├── no-window.md │ ├── no-with.md │ ├── prefer-as-const.md │ ├── prefer-ascii.md │ ├── prefer-const.md │ ├── prefer-namespace-keyword.md │ ├── prefer-primordials.md │ ├── react-no-danger-with-children.md │ ├── react-no-danger.md │ ├── react-rules-of-hooks.md │ ├── require-await.md │ ├── require-yield.md │ ├── single-var-declarator.md │ ├── triple-slash-reference.md │ ├── use-isnan.md │ ├── valid-typeof.md │ └── verbatim-module-syntax.md ├── lint_rules.client.ts ├── lume.ts ├── markdown-it ├── admonition.ts ├── codeblock-copy.ts ├── codeblock-title.ts ├── relative-path.ts └── replacer.ts ├── middleware ├── apiDocContentType.ts ├── functionRoutes.ts ├── functions │ ├── feedback.ts │ ├── feedback_test.ts │ ├── health.ts │ └── routes.ts ├── googleAnalytics.ts ├── null.ts └── redirects.ts ├── oldurls.json ├── overrides.css ├── prism.ts ├── reference ├── _components │ ├── Anchor.tsx │ ├── Arrow.tsx │ ├── Breadcrumbs.tsx │ ├── Check.tsx │ ├── Copy.tsx │ ├── Deprecated.tsx │ ├── DocBlockSubtitleClass.tsx │ ├── DocBlockSubtitleInterface.tsx │ ├── DocEntry.tsx │ ├── DocNodeKindIcon.tsx │ ├── Example.tsx │ ├── Function.tsx │ ├── HeaderItem.tsx │ ├── IndexSignature.tsx │ ├── Link.tsx │ ├── ModuleDoc.tsx │ ├── NamespaceSection.tsx │ ├── RefNav.tsx │ ├── Section.css │ ├── Section.tsx │ ├── See.tsx │ ├── SymbolContent.tsx │ ├── SymbolGroup.tsx │ ├── Tag.tsx │ └── UsageLarge.tsx └── reference.page.tsx ├── reference_gen ├── common.ts ├── deno-categories.json ├── deno-doc.ts ├── deno-types.ts ├── deno.jsonc ├── node-default-map.json ├── node-doc.ts ├── node-exclude-map.json ├── node-rewrite-map.json ├── node-symbol-map.json ├── node-types.ts ├── node_descriptions │ ├── assert.yaml │ ├── async_hooks.yaml │ ├── buffer.yaml │ ├── child_process.yaml │ ├── cluster.yaml │ ├── console.yaml │ ├── crypto.yaml │ ├── dgram.yaml │ ├── diagnostics_channel.yaml │ ├── dns.yaml │ ├── domain.yaml │ ├── events.yaml │ ├── fs--promises.yaml │ ├── fs.yaml │ ├── http.yaml │ ├── http2.yaml │ ├── https.yaml │ ├── inspector.yaml │ ├── module.yaml │ ├── net.yaml │ ├── os.yaml │ ├── path.yaml │ ├── perf_hooks.yaml │ ├── process.yaml │ ├── punycode.yaml │ ├── querystring.yaml │ ├── readline.yaml │ ├── repl.yaml │ ├── sea.yaml │ ├── sqlite.yaml │ ├── stream.yaml │ ├── string_decoder.yaml │ ├── test.yaml │ ├── timers.yaml │ ├── tls.yaml │ ├── trace_events.yaml │ ├── tty.yaml │ ├── url.yaml │ ├── util.yaml │ ├── v8.yaml │ ├── vm.yaml │ ├── wasi.yaml │ ├── worker_threads.yaml │ └── zlib.yaml ├── web-categories.json └── web-doc.ts ├── replacements.json ├── runtime ├── _data.ts ├── contributing │ ├── architecture.md │ ├── docs.md │ ├── examples.md │ ├── images │ │ └── stickers.jpg │ ├── index.md │ ├── release_schedule.md │ └── style_guide.md ├── fundamentals │ ├── _category_.json │ ├── configuration.md │ ├── debugging.md │ ├── ffi.mdx │ ├── http_server.md │ ├── images │ │ ├── debugger1.png │ │ ├── debugger2.jpg │ │ ├── debugger3.jpg │ │ ├── debugger4.jpg │ │ ├── debugger5.jpg │ │ ├── debugger7.jpg │ │ ├── jb-ide-debug.png │ │ ├── node_modules_dir.png │ │ ├── private-github-new-token.png │ │ ├── private-github-token-display.png │ │ └── private-pat.png │ ├── index.md │ ├── linting_and_formatting.mdx │ ├── modules.md │ ├── node.md │ ├── open_telemetry.md │ ├── security.md │ ├── stability_and_releases.md │ ├── standard_library.mdx │ ├── testing.md │ ├── typescript.md │ ├── web_dev.md │ └── workspaces.md ├── getting_started │ ├── _category_.json │ ├── command_line_interface.md │ ├── first_project.md │ ├── images │ │ ├── vscode-setup.png │ │ └── webstorm_setup.png │ ├── installation.md │ └── setup_your_environment.md ├── help.md ├── index.md └── reference │ ├── cli │ ├── _commands_reference.json │ ├── add.md │ ├── bench.md │ ├── bundler.md │ ├── check.md │ ├── clean.md │ ├── compile.md │ ├── completions.md │ ├── coverage.md │ ├── doc.md │ ├── env_variables.md │ ├── eval.md │ ├── fmt.md │ ├── index.md │ ├── info.md │ ├── init.md │ ├── install.md │ ├── jupyter.md │ ├── lint.md │ ├── lsp.md │ ├── outdated.md │ ├── publish.md │ ├── remove.md │ ├── repl.md │ ├── run.md │ ├── serve.md │ ├── task.md │ ├── test.md │ ├── types.md │ ├── uninstall.md │ ├── unstable_flags.md │ └── upgrade.md │ ├── continuous_integration.md │ ├── deno_namespace_apis.md │ ├── docker.md │ ├── documentation.md │ ├── env_variables.md │ ├── images │ ├── command_palette.png │ ├── jupyter-broadcast.mp4 │ ├── jupyter-cli.gif │ ├── jupyter-confirm-prompt.mp4 │ ├── jupyter-display.png │ ├── jupyter-html.png │ ├── jupyter-md.png │ ├── jupyter-plot.png │ ├── jupyter-svg.png │ ├── jupyter_notebook.png │ └── vscode_workspace_initialized.png │ ├── index.md │ ├── jsx.md │ ├── lint_plugins.md │ ├── lsp_integration.md │ ├── migration_guide.md │ ├── node_apis.md │ ├── ts_config_migration.md │ ├── vscode.md │ ├── wasm.md │ └── web_platform_apis.md ├── server.ts ├── static ├── .nojekyll ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon-precomposed.png ├── apple-touch-icon.png ├── deno-deploy-button.svg ├── deno-looking-up.svg ├── dino-only.svg ├── examples.png ├── examples │ ├── local.ts │ └── welcome.ts ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── fonts │ ├── courier │ │ ├── CourierPrime-Bold.ttf │ │ └── CourierPrime-Regular.ttf │ └── inter │ │ ├── Inter-Italic.woff2 │ │ ├── Inter-Regular.woff │ │ ├── Inter-Regular.woff2 │ │ ├── Inter-SemiBold.woff │ │ ├── Inter-SemiBold.woff2 │ │ └── Inter-SemiBoldItalic.woff2 ├── github-mark.png ├── img │ ├── checkmark.svg │ ├── chevron.svg │ ├── cover@xl.avif │ ├── dark.svg │ ├── deno-balloon.svg │ ├── deno-box.svg │ ├── deno-docs-dark.svg │ ├── deno-docs.svg │ ├── deno-shield.svg │ ├── deno-tool.svg │ ├── deno_hr_circle.svg │ ├── deno_logo.svg │ ├── docs-logotype.svg │ ├── docusaurus.png │ ├── fresh.svg │ ├── jsr.svg │ ├── jsx.svg │ ├── light.svg │ ├── logo-dark.svg │ ├── logo.svg │ ├── og.webp │ ├── react.svg │ ├── search.svg │ └── social.png ├── js │ ├── darkmode-toggle.client.js │ ├── darkmode.client.js │ ├── nav-toggle.client.js │ └── youtube-lite.client.js ├── reference_styles.css ├── robots.txt └── style.css ├── styleguide ├── _data.ts ├── components.mdx ├── index.md ├── og.md ├── og │ ├── cli-commands.md │ ├── color-override.md │ ├── short-title-and-long-description.md │ ├── short-title-and-short-description.md │ ├── title-and-description.md │ └── title-only.md └── typography.mdx ├── styles.css ├── subhosting ├── _data.ts ├── api │ ├── authentication.md │ ├── images │ │ ├── org-id.png │ │ └── subhosting-org-structure.svg │ └── index.md ├── index.md └── manual │ ├── acceptable_use_policy.md │ ├── events.md │ ├── index.md │ ├── planning_your_implementation.md │ ├── pricing_and_limits.md │ └── quick_start.md ├── tabs.client.ts ├── tailwind.config.js ├── test_llms_gen.ts ├── timeUtils.ts ├── types.ts └── update_lint_rules.ts /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu 2 | COPY --from=denoland/deno:bin-2.0.4 /deno /usr/local/bin/deno 3 | 4 | EXPOSE 3000 5 | EXPOSE 8000 6 | 7 | WORKDIR /app 8 | 9 | COPY . . 10 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Deno", 3 | "build": { 4 | "dockerfile": "Dockerfile" 5 | }, 6 | 7 | // Set *default* container specific settings.json values on container create. 8 | "customizations": { 9 | "vscode": { 10 | "extensions": ["denoland.vscode-deno"], 11 | "settings": { "terminal.integrated.shell.linux": "/bin/bash" } 12 | } 13 | }, 14 | 15 | "forwardPorts": [3000, 8000], 16 | 17 | "mounts": [], 18 | "remoteEnv": { 19 | "SOME_ENV": "some-value" 20 | }, 21 | "postCreateCommand": "deno install && cd reference_gen && deno task types && deno task doc && cd .." 22 | } 23 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | push: 4 | branches: [main] 5 | pull_request: 6 | branches: [main] 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | timeout-minutes: 10 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: denoland/setup-deno@v2 14 | with: 15 | cache: true 16 | deno-version: "2.3.1" 17 | 18 | - run: deno fmt --check 19 | - run: deno task test 20 | -------------------------------------------------------------------------------- /.github/workflows/update_versions.yml: -------------------------------------------------------------------------------- 1 | name: update_versions 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build: 8 | name: update replacements.json 9 | runs-on: ubuntu-latest 10 | timeout-minutes: 30 11 | 12 | steps: 13 | - name: Clone repository 14 | uses: actions/checkout@v4 15 | with: 16 | token: ${{ secrets.DENOBOT_PAT }} 17 | 18 | - name: Install deno 19 | uses: denoland/setup-deno@v2 20 | 21 | - name: Build and Create PR 22 | env: 23 | GITHUB_TOKEN: ${{ secrets.DENOBOT_PAT }} 24 | GH_WORKFLOW_ACTOR: ${{ github.actor }} 25 | run: | 26 | git config user.email "${{ github.actor }}@users.noreply.github.com" 27 | git config user.name "${{ github.actor }}" 28 | deno run -A --no-lock .github/workflows/update_versions.ts --create-pr 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | _cache 3 | _broken_links.json 4 | 5 | .idea 6 | 7 | node_modules 8 | 9 | reference_gen/gen 10 | reference_gen/node_modules 11 | reference_gen/types 12 | 13 | # LLM documentation files (generated at build time) 14 | static/llms.txt 15 | static/llms-full.txt 16 | 17 | .DS_Store 18 | .env 19 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "deno.enable": true, 3 | "editor.defaultFormatter": "denoland.vscode-deno", 4 | "editor.formatOnSave": true, 5 | "editor.formatOnPaste": false, 6 | "[typescriptreact]": { 7 | "editor.defaultFormatter": "denoland.vscode-deno" 8 | }, 9 | "editor.detectIndentation": true, 10 | "[markdown]": { 11 | "editor.defaultFormatter": "denoland.vscode-deno" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /404/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Page not found" 3 | description: "404, can't find the page you're looking for." 4 | layout: "raw.tsx" 5 | --- 6 | 7 | 8 | -------------------------------------------------------------------------------- /_components/Admonition.tsx: -------------------------------------------------------------------------------- 1 | type AdmonitionType = 2 | | "note" 3 | | "caution" 4 | | "tip"; 5 | 6 | export default function Admonition( 7 | props: { type: AdmonitionType; children: any }, 8 | ) { 9 | return ( 10 |
11 |
{props.type}
12 |

13 | {/* This is how lume seems to add a space between the title and the content (sorry for the hacky solution)*/} 14 | {props.children} 15 |
16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /_components/Banner.css: -------------------------------------------------------------------------------- 1 | .banner { 2 | @apply flex flex-col gap-4 p-4 border-l-4 text-runtime-foreground 3 | bg-runtime-background dark:bg-background-secondary border-runtime-500; 4 | width: 100%; 5 | margin: 4rem 0; 6 | } 7 | 8 | .banner-deploy { 9 | @apply border-deploy-500 bg-deploy-50 dark:bg-background-secondary; 10 | } 11 | -------------------------------------------------------------------------------- /_components/Banner.tsx: -------------------------------------------------------------------------------- 1 | export default function Banner(props: { children: any; type: string }) { 2 | return ( 3 |
6 | {props.children} 7 |
8 | ); 9 | } 10 | 11 | export const css = "@import './_components/Banner.css';"; 12 | -------------------------------------------------------------------------------- /_components/Base.tsx: -------------------------------------------------------------------------------- 1 | import type { PageBase, ToCCtx } from "@deno/doc"; 2 | 3 | export default function Base( 4 | { data, comp, children }: Lume.Data & { data: PageBase }, 5 | _helpers: Lume.Helpers, 6 | ) { 7 | return ( 8 | <> 9 |
10 | 11 | 12 |
13 | {children} 14 |
15 |
16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /_components/Breadcrumbs.css: -------------------------------------------------------------------------------- 1 | .crumbs { 2 | display: flex; 3 | flex-wrap: wrap; 4 | text-align: center; 5 | margin-top: 0.5rem; 6 | margin-left: -0.75rem; 7 | color: hsl(var(--foreground-secondary)); 8 | } 9 | 10 | .crumb-link { 11 | display: flex; 12 | align-items: center; 13 | &::after { 14 | content: ""; 15 | width: 1em; 16 | height: 1em; 17 | background: url(./img/chevron.svg) no-repeat center; 18 | display: inline-block; 19 | margin-left: 1rem; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /_components/CTA.css: -------------------------------------------------------------------------------- 1 | .docs-cta { 2 | @apply border text-balance text-black font-bold inline-block py-3.5 px-6 3 | rounded-full w-max hover:no-underline transition-colors duration-200 m-4 4 | ml-0; 5 | } 6 | 7 | .runtime-cta, 8 | .deploy-cta { 9 | @apply border-gray-4 hover:!no-underline !text-gray-4; 10 | } 11 | 12 | .runtime-cta { 13 | @apply bg-runtime-400 border-runtime-400 hover:bg-runtime-300; 14 | } 15 | 16 | .deploy-cta { 17 | @apply bg-deploy-500 border-deploy-500 hover:bg-deploy-400; 18 | } 19 | 20 | .jsr-cta { 21 | @apply bg-jsr-yellow-400 border-jsr-cyan-950 !text-jsr-cyan-950 border-2 22 | hover:!no-underline hover:bg-jsr-yellow-300; 23 | } 24 | -------------------------------------------------------------------------------- /_components/CTA.tsx: -------------------------------------------------------------------------------- 1 | export default function CTA( 2 | { href, children, type }: { href: string; children: string; type: string }, 3 | ) { 4 | return ( 5 | 6 | {children} 7 | 8 | ); 9 | } 10 | 11 | export const css = "@import './_components/CTA.css';"; 12 | -------------------------------------------------------------------------------- /_components/Columns.css: -------------------------------------------------------------------------------- 1 | .columns { 2 | margin: 2rem 0; 3 | div { 4 | margin-bottom: 2rem; 5 | } 6 | } 7 | 8 | @media (min-width: 750px) { 9 | .columns { 10 | display: flex; 11 | justify-content: space-between; 12 | gap: 2rem; 13 | 14 | div { 15 | flex: 1; 16 | text-wrap: balance; 17 | margin-bottom: 1rem; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /_components/Columns.tsx: -------------------------------------------------------------------------------- 1 | export default function Columns(props: { children: any }) { 2 | return
{props.children}
; 3 | } 4 | 5 | export const css = `@import './_components/Columns.css';`; 6 | -------------------------------------------------------------------------------- /_components/ExternalLink.css: -------------------------------------------------------------------------------- 1 | .external { 2 | display: none; 3 | } 4 | @media (min-width: 650px) { 5 | .external { 6 | display: block; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /_components/ExternalLink.tsx: -------------------------------------------------------------------------------- 1 | export default function ExternalLink( 2 | { href, children }: { href: string; children: string }, 3 | ) { 4 | return ( 5 | 10 | {children} 11 | 12 | ); 13 | } 14 | 15 | export const css = "@import './_components/ExternalLink.css';"; 16 | -------------------------------------------------------------------------------- /_components/FourOhFour.css: -------------------------------------------------------------------------------- 1 | .fourohfour { 2 | display: grid; 3 | place-items: center; 4 | padding: 6rem 5vw 0; 5 | } 6 | -------------------------------------------------------------------------------- /_components/FourOhFour.tsx: -------------------------------------------------------------------------------- 1 | export default function () { 2 | return ( 3 |
4 |

5 |
6 | 404 7 |
8 | Sorry, couldn’t find that page. 9 |

10 |

11 | Maybe one of these links has what you're looking for? 12 |

13 |
14 | ); 15 | } 16 | 17 | export const css = "@import './_components/FourOhFour.css';"; 18 | -------------------------------------------------------------------------------- /_components/Hamburger.tsx: -------------------------------------------------------------------------------- 1 | export default function () { 2 | return ( 3 | <> 4 | 9 | 10 | 11 | ); 12 | } 13 | 14 | export const css = "@import './_components/Hamburger.css';"; 15 | -------------------------------------------------------------------------------- /_components/Header.tsx: -------------------------------------------------------------------------------- 1 | import { NavData } from "../types.ts"; 2 | 3 | export default function (data: Lume.Data) { 4 | return ( 5 |
6 | 7 | 8 | 9 | 22 | 23 | deno.com 24 | 25 | 26 | 27 |
28 | ); 29 | } 30 | 31 | export const css = "@import './_components/Header.css';"; 32 | -------------------------------------------------------------------------------- /_components/HeaderAnchor.tsx: -------------------------------------------------------------------------------- 1 | export function HeaderAnchor(props: { id: string }) { 2 | return ( 3 | 4 | Jump to heading 5 | 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /_components/Heading.css: -------------------------------------------------------------------------------- 1 | h2.heading { 2 | @apply text-3xl md:text-4xl font-semibold underline underline-offset-8 mb-6; 3 | } 4 | 5 | h3.heading { 6 | @apply text-xl md:text-2xl font-semibold underline underline-offset-8 mb-4; 7 | } 8 | 9 | .heading-runtime { 10 | @apply decoration-runtime-500; 11 | } 12 | 13 | .heading-deploy { 14 | @apply decoration-deploy-500; 15 | } 16 | 17 | .heading-purple { 18 | @apply decoration-purple-500; 19 | } 20 | -------------------------------------------------------------------------------- /_components/Heading.tsx: -------------------------------------------------------------------------------- 1 | export default function Heading( 2 | props: { children: any; type: string; level: number }, 3 | ) { 4 | const Tag = `h${props.level}` as any; 5 | 6 | return ( 7 | 8 | {props.children} 9 | 10 | ); 11 | } 12 | 13 | export const css = `@import './_components/Heading.css';`; 14 | -------------------------------------------------------------------------------- /_components/Hero.css: -------------------------------------------------------------------------------- 1 | .hero { 2 | background-size: 0; 3 | width: 100%; 4 | } 5 | 6 | @media (min-width: 768px) { 7 | .hero { 8 | padding-right: 400px; 9 | background-size: 360px; 10 | background-repeat: no-repeat; 11 | background-position: right; 12 | } 13 | } 14 | 15 | .hero h1 { 16 | @apply text-4xl md:text-5xl mb-2 md:mb-6 font-bold; 17 | } 18 | 19 | .hero p { 20 | margin-bottom: 2rem; 21 | font-size: 1.15rem; 22 | line-height: 1.75rem; 23 | text-wrap: balance; 24 | max-width: 600px; 25 | } 26 | -------------------------------------------------------------------------------- /_components/Hero.tsx: -------------------------------------------------------------------------------- 1 | export default function (props: { children: any; bgImage: string }) { 2 | return ( 3 |
4 | {props.children} 5 |
6 | ); 7 | } 8 | 9 | export const css = "@import './_components/Hero.css';"; 10 | -------------------------------------------------------------------------------- /_components/MainNav.css: -------------------------------------------------------------------------------- 1 | .main-nav { 2 | display: flex; 3 | flex-direction: column; 4 | margin: 0.5rem 0.5rem 1rem; 5 | padding: 0.5rem; 6 | border-radius: 0.5rem; 7 | border: 1px solid hsl(var(--background-tertiary)); 8 | background-color: hsl(var(--background-secondary)); 9 | list-style: none; 10 | } 11 | 12 | .main-nav-link { 13 | display: block; 14 | padding: 0.5rem 0.75rem; 15 | border-radius: 0.25rem; 16 | color: hsl(var(--foreground-primary)); 17 | &:hover { 18 | background-color: hsl(var(--background-tertiary)); 19 | text-decoration: none; 20 | } 21 | } 22 | 23 | .main-nav-link[data-active] { 24 | font-weight: bold; 25 | background-color: hsl(var(--background-tertiary)); 26 | } 27 | 28 | @media (min-width: 1024px) { 29 | .main-nav { 30 | display: none; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /_components/MainNav.tsx: -------------------------------------------------------------------------------- 1 | import { NavData } from "../types.ts"; 2 | 3 | export default function (data: Lume.Data) { 4 | return ( 5 | 22 | ); 23 | } 24 | 25 | export const css = "@import './_components/MainNav.css';"; 26 | -------------------------------------------------------------------------------- /_components/RefHeader.css: -------------------------------------------------------------------------------- 1 | .refheader { 2 | position: sticky; 3 | top: calc(4rem - 1px); 4 | display: flex; 5 | align-items: center; 6 | padding-left: 0; 7 | background-color: hsl(var(--background-secondary)); 8 | border-bottom: 1px solid hsl(var(--foreground-tertiary)); 9 | z-index: 5; 10 | height: 3rem; 11 | } 12 | 13 | .refheader-link { 14 | white-space: nowrap; 15 | font-size: clamp(0.875rem, 1vw + 0.5rem, 1rem); 16 | } 17 | 18 | .refheader-link[data-active="true"] { 19 | color: hsl(var(--primary)); 20 | } 21 | 22 | .nav[data-section="api"] { 23 | height: calc(100vh - 6.5rem); 24 | top: 6.5rem; 25 | padding-top: 0.5rem; 26 | } 27 | 28 | /* putting other reference styles in here for now until they are moved out into components*/ 29 | 30 | .refcrumbs { 31 | position: sticky; 32 | top: 6.5rem; 33 | width: 100%; 34 | padding: 1rem; 35 | padding-left: 0 !important; 36 | margin: 0; 37 | background-color: hsl(var(--background-primary)); 38 | z-index: 2; 39 | } 40 | -------------------------------------------------------------------------------- /_components/SearchInput.css: -------------------------------------------------------------------------------- 1 | .search { 2 | margin-bottom: 0; 3 | } 4 | 5 | .search-input { 6 | width: 100%; 7 | min-width: 10rem; 8 | border-radius: 0.5rem; 9 | font-size: 0.875rem; 10 | line-height: 1.5rem; 11 | padding: 0.375rem 0.75rem 0.375rem 0.5rem; 12 | padding-left: 2em; 13 | border: 1px solid; 14 | transition: all 150ms ease-in-out; 15 | background: url(/img/search.svg) no-repeat 0.5em 50%; 16 | background-size: 1em; 17 | background-color: hsl(var(--foreground-quaternary)); 18 | color: hsl(var(--foreground-primary)); 19 | border-color: hsl(var(--foreground-tertiary)); 20 | &:hover, &:focus { 21 | background-color: hsl(var(--background-secondary)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /_components/SearchInput.tsx: -------------------------------------------------------------------------------- 1 | export default function SearchInput() { 2 | return ( 3 | <> 4 |
10 | 17 | 18 |
19 | 20 | ); 21 | } 22 | 23 | export const css = `@import "./_components/SearchInput.css";`; 24 | -------------------------------------------------------------------------------- /_components/SubNav.tsx: -------------------------------------------------------------------------------- 1 | export default function ( 2 | { data, currentUrl }: { 3 | data: Lume.Data; 4 | currentUrl: string; 5 | }, 6 | ) { 7 | const navData = data.page?.data?.secondaryNav; 8 | if (!navData || navData.length === 0) { 9 | return null; 10 | } 11 | 12 | return ( 13 | 30 | ); 31 | } 32 | 33 | export const css = "@import './_components/RefHeader.css';"; 34 | -------------------------------------------------------------------------------- /_components/TabItem.tsx: -------------------------------------------------------------------------------- 1 | export default function TabItem() { 2 | return
; 3 | } 4 | -------------------------------------------------------------------------------- /_components/TableOfContents.tsx: -------------------------------------------------------------------------------- 1 | import type { TableOfContentsItem as TableOfContentsItem_ } from "../types.ts"; 2 | 3 | export default function TableOfContents({ data, toc }: { 4 | data: Lume.Data; 5 | toc: TableOfContentsItem_[]; 6 | }) { 7 | if (!toc || toc.length === 0) { 8 | return null; 9 | } 10 | 11 | return ( 12 | 17 | ); 18 | } 19 | 20 | export const css = `@import './_components/TableOfContents.css';`; 21 | -------------------------------------------------------------------------------- /_components/TableOfContentsItem.tsx: -------------------------------------------------------------------------------- 1 | import type { TableOfContentsItem as TableOfContentsItem_ } from "../types.ts"; 2 | 3 | export default function TableOfContentsItem( 4 | props: { item: TableOfContentsItem_ }, 5 | ) { 6 | return ( 7 |
  • 8 | 12 | {props.item.text.replaceAll(/ \([0-9/]+?\)/g, "")} 13 | 14 | {props.item.children.length > 0 && ( 15 | 20 | )} 21 |
  • 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /_components/TableOfContentsMobile.tsx: -------------------------------------------------------------------------------- 1 | import type { TableOfContentsItem as TableOfContentsItem_ } from "../types.ts"; 2 | 3 | export default function TableOfContents({ data, toc }: { 4 | data: Lume.Data; 5 | toc: TableOfContentsItem_[]; 6 | }) { 7 | if (!toc || toc.length === 0) { 8 | return null; 9 | } 10 | 11 | return ( 12 |
    13 | 14 | On this page 15 | 16 | 17 | 22 |
    23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /_components/Tabs.tsx: -------------------------------------------------------------------------------- 1 | export default function Tabs() { 2 | return
    ; 3 | } 4 | -------------------------------------------------------------------------------- /_components/ThemeToggle.css: -------------------------------------------------------------------------------- 1 | .theme-toggle { 2 | flex-shrink: 0; 3 | height: 2.3rem; 4 | width: 2.3rem; 5 | font-size: 0; 6 | color: transparent; 7 | background: transparent no-repeat center; 8 | background-size: 1.5rem; 9 | cursor: pointer; 10 | border-radius: 0.25rem; 11 | border: 1px solid transparent; 12 | transition: all 200ms ease-in-out; 13 | color: hsl(var(--foreground-secondary)); 14 | &:hover { 15 | text-decoration: none; 16 | background-color: hsl(var(--background-secondary)); 17 | border-color: hsl(var(--background-tertiary)); 18 | } 19 | } 20 | 21 | .light .theme-toggle { 22 | background-image: url(/img/dark.svg); 23 | } 24 | 25 | .dark .theme-toggle { 26 | background-image: url(/img/light.svg); 27 | } 28 | -------------------------------------------------------------------------------- /_components/ThemeToggle.tsx: -------------------------------------------------------------------------------- 1 | export const css = "@import './_components/ThemeToggle.css';"; 2 | 3 | export default function () { 4 | return ( 5 | 13 | ); 14 | } 15 | 16 | export const js = ` 17 | import "/js/darkmode.client.js"; 18 | import "/js/darkmode-toggle.client.js"; 19 | `; 20 | -------------------------------------------------------------------------------- /_components/ToTop.tsx: -------------------------------------------------------------------------------- 1 | export default function ToTop() { 2 | return ( 3 | 4 | 5 | Back to top 6 | 7 | 8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /_config-styleguide.ts: -------------------------------------------------------------------------------- 1 | // Further refine the global Lume config for this section of the site 2 | import site from "./_config.ts"; 3 | 4 | // Ignore everything not in the styleguide folder 5 | site.ignore((path) => { 6 | return path.match(/^\/styleguide.*$/) === null; 7 | }); 8 | 9 | export default site; 10 | -------------------------------------------------------------------------------- /_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigation": [ 3 | { 4 | "name": "Manual", 5 | "href": "/runtime/" 6 | }, 7 | { 8 | "name": "API reference", 9 | "href": "/api/" 10 | }, 11 | { 12 | "name": "Examples", 13 | "href": "/examples/" 14 | }, 15 | { 16 | "name": "Services", 17 | "href": "/deploy/manual/", 18 | "style": "services" 19 | } 20 | ], 21 | "sidebar": [ 22 | { 23 | "items": [ 24 | { 25 | "title": "deno.com", 26 | "href": "https://deno.com" 27 | } 28 | ] 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /_includes/raw.tsx: -------------------------------------------------------------------------------- 1 | export const layout = "layout.tsx"; 2 | 3 | export default function Raw(props: Lume.Data, helpers: Lume.Helpers) { 4 | const reference = props.url.startsWith("/api"); 5 | 6 | return ( 7 | <> 8 |
    9 | {props.children} 10 | {reference && } 11 |
    12 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /_includes/reference/allSymbols.tsx: -------------------------------------------------------------------------------- 1 | import type { AllSymbolsCtx } from "@deno/doc"; 2 | 3 | export const layout = "doc.tsx"; 4 | 5 | export default function AllSymbols( 6 | { comp, data }: { data: AllSymbolsCtx } & Lume.Data, 7 | _helpers: Lume.Helpers, 8 | ) { 9 | return ( 10 | 11 |
    12 | 13 |
    14 |
    15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /_includes/reference/index.tsx: -------------------------------------------------------------------------------- 1 | import type { IndexCtx } from "@deno/doc"; 2 | 3 | export const layout = "doc.tsx"; 4 | 5 | export default function Index( 6 | { data, comp }: { data: IndexCtx } & Lume.Data, 7 | _helpers: Lume.Helpers, 8 | ) { 9 | return ( 10 | 11 |
    12 | 13 | {data.module_doc && } 14 | {data.overview && 15 | } 16 |
    17 |
    18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /_includes/reference/symbol.tsx: -------------------------------------------------------------------------------- 1 | import type { SymbolPageCtx } from "@deno/doc"; 2 | export const layout = "doc.tsx"; 3 | 4 | export default function Symbol( 5 | { data, comp }: { data: SymbolPageCtx } & Lume.Data, 6 | _helpers: Lume.Helpers, 7 | ) { 8 | return ( 9 | 10 | 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /_includes/video.tsx: -------------------------------------------------------------------------------- 1 | export const layout = "doc.tsx"; 2 | 3 | export default function Raw(data: Lume.Data) { 4 | return ( 5 | <> 6 | 7 | 8 | {data.children} 9 | 10 |
    11 | Find more videos in the Examples page{" "} 12 | and on our{" "} 13 | YouTube channel. 14 |
    15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /copy.client.ts: -------------------------------------------------------------------------------- 1 | document.addEventListener("click", (event) => { 2 | const btn = (event.target as HTMLElement).closest("button[data-copy]"); 3 | 4 | if (!btn) { 5 | return; 6 | } 7 | 8 | let textToCopy = btn.getAttribute("data-copy") as string; 9 | 10 | // CLEAN COMMANDS: Remove leading spaces, $, and > from each line 11 | textToCopy = textToCopy.replace(/^[\$>\s]+/, ""); 12 | 13 | navigator?.clipboard?.writeText(textToCopy).then(() => { 14 | if (!btn) { 15 | return; 16 | } 17 | 18 | const copyIcon = btn.querySelector(".copy-icon"); 19 | const checkIcon = btn.querySelector(".check-icon"); 20 | 21 | if (copyIcon && checkIcon) { 22 | copyIcon.classList.add("hidden"); 23 | checkIcon.classList.remove("hidden"); 24 | 25 | setTimeout(() => { 26 | copyIcon.classList.remove("hidden"); 27 | checkIcon.classList.add("hidden"); 28 | }, 2000); 29 | } 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /deploy/docs-images/add_custom_domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/add_custom_domain.png -------------------------------------------------------------------------------- /deploy/docs-images/blank_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/blank_project.png -------------------------------------------------------------------------------- /deploy/docs-images/change_dns_records.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/change_dns_records.png -------------------------------------------------------------------------------- /deploy/docs-images/discord-slash-command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/discord-slash-command.png -------------------------------------------------------------------------------- /deploy/docs-images/dns_records_modal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/dns_records_modal.png -------------------------------------------------------------------------------- /deploy/docs-images/fauna1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/fauna1.png -------------------------------------------------------------------------------- /deploy/docs-images/fauna2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/fauna2.png -------------------------------------------------------------------------------- /deploy/docs-images/get_certificates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/get_certificates.png -------------------------------------------------------------------------------- /deploy/docs-images/green_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/green_check.png -------------------------------------------------------------------------------- /deploy/docs-images/neon_postgres_env_variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/neon_postgres_env_variable.png -------------------------------------------------------------------------------- /deploy/docs-images/new_github_repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/new_github_repo.png -------------------------------------------------------------------------------- /deploy/docs-images/organizations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/organizations.png -------------------------------------------------------------------------------- /deploy/docs-images/postgres_env_variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/postgres_env_variable.png -------------------------------------------------------------------------------- /deploy/docs-images/preview_deployment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/preview_deployment.png -------------------------------------------------------------------------------- /deploy/docs-images/project_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/project_name.png -------------------------------------------------------------------------------- /deploy/docs-images/promote_to_production.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/promote_to_production.png -------------------------------------------------------------------------------- /deploy/docs-images/proxy_to_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/proxy_to_example.png -------------------------------------------------------------------------------- /deploy/docs-images/vite-branch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/vite-branch.png -------------------------------------------------------------------------------- /deploy/docs-images/vite-deploy-yaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/vite-deploy-yaml.png -------------------------------------------------------------------------------- /deploy/docs-images/vite-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/vite-link.png -------------------------------------------------------------------------------- /deploy/docs-images/vite-ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/vite-ok.png -------------------------------------------------------------------------------- /deploy/docs-images/vite-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/docs-images/vite-project.png -------------------------------------------------------------------------------- /deploy/early-access/images/app_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/early-access/images/app_config.png -------------------------------------------------------------------------------- /deploy/early-access/images/build_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/early-access/images/build_config.png -------------------------------------------------------------------------------- /deploy/early-access/images/build_logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/early-access/images/build_logs.png -------------------------------------------------------------------------------- /deploy/early-access/images/create_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/early-access/images/create_app.png -------------------------------------------------------------------------------- /deploy/early-access/images/create_org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/early-access/images/create_org.png -------------------------------------------------------------------------------- /deploy/early-access/images/env_var.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/early-access/images/env_var.png -------------------------------------------------------------------------------- /deploy/early-access/images/logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/early-access/images/logs.png -------------------------------------------------------------------------------- /deploy/early-access/images/select_org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/early-access/images/select_org.png -------------------------------------------------------------------------------- /deploy/early-access/images/trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/early-access/images/trace.png -------------------------------------------------------------------------------- /deploy/early-access/images/traces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/early-access/images/traces.png -------------------------------------------------------------------------------- /deploy/early-access/support/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Support and Feedback 3 | --- 4 | 5 | :::info 6 | 7 | You are viewing the documentation for Deno DeployEA. Looking for 8 | Deploy Classic documentation? [View it here](/deploy/). 9 | 10 | ::: 11 | 12 | If you have any questions or feedback about Deno Deploy Early Access, please 13 | reach out to us on the [Deno Discord](https://discord.gg/deno) in the 14 | `#deploy-ea` channel or [contact us](mailto:deploy@deno.com). 15 | 16 | We are actively working on improving the platform and would love to hear your 17 | thoughts! 18 | -------------------------------------------------------------------------------- /deploy/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/index.md -------------------------------------------------------------------------------- /deploy/kv/manual/_admonition.tsx: -------------------------------------------------------------------------------- 1 | export function Admonition({ type, children }) { 2 | return
    TODO
    ; 3 | } 4 | 5 | // :::caution Deno KV is currently in beta 6 | 7 | // Deno KV and related cloud primitive APIs like queues and cron are currently 8 | // **experimental** and **subject to change**. While we do our best to ensure data 9 | // durability, data loss is possible, especially around Deno updates. 10 | 11 | // Deno programs that use KV require the `--unstable` flag when launching the 12 | // program, as shown below: 13 | 14 | // ```sh 15 | // deno run -A --unstable my_kv_code.ts 16 | // ``` 17 | 18 | // ::: 19 | -------------------------------------------------------------------------------- /deploy/kv/manual/images/backup-add-bucket-to-dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/kv/manual/images/backup-add-bucket-to-dash.png -------------------------------------------------------------------------------- /deploy/kv/manual/images/backup-bucket-create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/kv/manual/images/backup-bucket-create.png -------------------------------------------------------------------------------- /deploy/kv/manual/images/backup-gcs-bucket-create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/kv/manual/images/backup-gcs-bucket-create.png -------------------------------------------------------------------------------- /deploy/kv/manual/images/backup-gcs-create-hmac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/kv/manual/images/backup-gcs-create-hmac.png -------------------------------------------------------------------------------- /deploy/kv/manual/images/backup-gcs-grant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/kv/manual/images/backup-gcs-grant.png -------------------------------------------------------------------------------- /deploy/kv/manual/images/cron-tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/kv/manual/images/cron-tasks.png -------------------------------------------------------------------------------- /deploy/kv/manual/images/kv-connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/kv/manual/images/kv-connect.png -------------------------------------------------------------------------------- /deploy/kv/tutorials/images/github_webhook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/kv/tutorials/images/github_webhook.png -------------------------------------------------------------------------------- /deploy/manual/how-to-deploy.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Deploy with GitHub integration" 3 | --- 4 | 5 | The simplest way to deploy more complex projects is via our Github integration. 6 | This allows you to link a Deno Deploy project to a GitHub repository. Every time 7 | you push to the repository, your changes will be automatically deployed. 8 | 9 | Via the Github integration, you can add a Github Action that defines a build 10 | step in your deployment process. 11 | 12 | See [the Github integration page](ci_github) for more details. 13 | 14 | ### Deploy from command line with [`deployctl`](./deployctl.md) 15 | 16 | `deployctl` is a command line tool for deploying your code to Deno Deploy. You 17 | can control more details of your deployment than the above automatic GitHub 18 | integration by using `deployctl`. 19 | 20 | See [the `deployctl` page](./deployctl.md) for more details. 21 | 22 | ### Deploy with playground 23 | 24 | The easiest way to deploy some code is via a Deno Deploy playground. 25 | 26 | See the [playground page](playgrounds) for more details. 27 | -------------------------------------------------------------------------------- /deploy/manual/images/deploy_onboarding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/manual/images/deploy_onboarding.png -------------------------------------------------------------------------------- /deploy/manual/images/deployctl-deployments-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/manual/images/deployctl-deployments-list.png -------------------------------------------------------------------------------- /deploy/manual/images/deployctl-deployments-show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/manual/images/deployctl-deployments-show.png -------------------------------------------------------------------------------- /deploy/manual/images/project_deployments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/manual/images/project_deployments.png -------------------------------------------------------------------------------- /deploy/manual/regions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Regions" 3 | --- 4 | 5 | Deno Deploy deploys your code throughout the world. Each new request is served 6 | from the closest region to your user. Deploy is presently located in the 7 | following regions: 8 | 9 | - Singapore (`asia-southeast1`) 10 | - London (`europe-west2`) 11 | - Frankfurt (`europe-west3`) 12 | - Sao Paolo (`southamerica-east1`) 13 | - North Virginia (`us-east4`) 14 | - California (`us-west2`) 15 | 16 | This list will be maintained to reflect the latest summary of our regions. 17 | 18 | Code is deployed to all regions and is served from the region closest to the end 19 | user to minimize latency. It is not currently possible to restrict the regions 20 | in which your code is deployed. 21 | -------------------------------------------------------------------------------- /deploy/manual/running-scripts-locally.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Local development" 3 | --- 4 | 5 | For local development you can use the `deno` CLI. To install `deno`, follow the 6 | instructions in the 7 | [Deno manual](https://deno.land/manual/getting_started/installation). 8 | 9 | After installation, you can run your scripts locally: 10 | 11 | ```shell 12 | $ deno run --allow-net=:8000 https://deno.com/examples/hello.js 13 | Listening on http://localhost:8000 14 | ``` 15 | 16 | To watch for file changes add the `--watch` flag: 17 | 18 | ```shell 19 | $ deno run --allow-net=:8000 --watch ./main.js 20 | Listening on http://localhost:8000 21 | ``` 22 | 23 | For more information about the Deno CLI, and how to configure your development 24 | environment and IDE, visit the Deno Manual's [Getting Started][manual-gs] 25 | section. 26 | 27 | [manual-gs]: https://deno.land/manual/getting_started 28 | -------------------------------------------------------------------------------- /deploy/tutorials/images/simple_api_dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/tutorials/images/simple_api_dashboard.png -------------------------------------------------------------------------------- /deploy/tutorials/images/simple_api_deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/tutorials/images/simple_api_deploy.png -------------------------------------------------------------------------------- /deploy/tutorials/images/simple_api_deploy_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/deploy/tutorials/images/simple_api_deploy_settings.png -------------------------------------------------------------------------------- /deploy/tutorials/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Tutorials" 3 | sidebar_title: "Overview" 4 | pagination_next: /deploy/tutorials/tutorial-http-server 5 | --- 6 | 7 | Here, you'll find a collection of tutorials and example applications for Deno 8 | Deploy. Check our ever expanding list of tutorials in the nav, and explore 9 | [examples.deno.land](https://examples.deno.land) for even more. 10 | 11 | ## Code examples 12 | 13 | - [Build a simple API server](./simple-api.md) 14 | - [Serve static assets](./static-site.md) 15 | 16 | ## App building tutorials 17 | 18 | - [Build a Fresh app](./fresh.md) 19 | - [Build a Discord slash command](./discord-slash.md) 20 | - [Build a site with Vite](./vite.md) 21 | -------------------------------------------------------------------------------- /deploy/tutorials/tutorial-blog-fresh.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Build a blog with Fresh" 3 | oldUrl: 4 | - /deploy/docs/tutorial-blog-fresh/ 5 | --- 6 | 7 | Tutorial [here](https://deno.com/blog/build-a-blog-with-fresh). 8 | -------------------------------------------------------------------------------- /deploy/tutorials/tutorial-hugo-blog.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Build a blog with Hugo" 3 | oldUrl: 4 | - /deploy/docs/tutorial-hugo-blog/ 5 | --- 6 | 7 | Tutorial [here](https://deno.com/blog/hugo-blog-with-deno-deploy). 8 | -------------------------------------------------------------------------------- /examples/_components/CopyButton.tsx: -------------------------------------------------------------------------------- 1 | export function CopyButton(props: { text: string }) { 2 | return ( 3 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /examples/_components/ExampleIcon.tsx: -------------------------------------------------------------------------------- 1 | export function ExampleIcon() { 2 | return ( 3 | 8 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /examples/_components/TutorialIcon.tsx: -------------------------------------------------------------------------------- 1 | export function TutorialIcon() { 2 | return ( 3 | 8 | 16 | 24 | 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /examples/_pages/VideoPage.tsx: -------------------------------------------------------------------------------- 1 | import { EmbedVideo } from "../_components/EmbedVideo.tsx"; 2 | import { VideoReference } from "../types.ts"; 3 | 4 | type Props = { video: VideoReference }; 5 | 6 | export default function VideoPage({ video }: Props) { 7 | return ( 8 | <> 9 | 10 |
    11 | Find more videos in the Examples page{" "} 12 | and on our{" "} 13 | YouTube channel. 14 |
    15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /examples/_pages/examples_test.ts: -------------------------------------------------------------------------------- 1 | import { join } from "@std/path"; 2 | import { walk } from "@std/fs"; 3 | import { assertEquals, assertNotMatch } from "@std/assert"; 4 | 5 | const decoder = new TextDecoder(); 6 | 7 | Deno.test("Check examples", async (t) => { 8 | for await (const item of walk("./examples/scripts/")) { 9 | const path = join("examples/scripts", item.name); 10 | 11 | if (!path.endsWith(".ts")) continue; 12 | 13 | await t.step("Check graph: " + path, async () => { 14 | const result = await new Deno.Command(Deno.execPath(), { 15 | args: ["info", path], 16 | }).output(); 17 | assertEquals(result.code, 0); 18 | assertNotMatch(decoder.decode(result.stdout), /\(resolve error\)/); 19 | }); 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /examples/index.tsx: -------------------------------------------------------------------------------- 1 | export const layout = "raw.tsx"; 2 | 3 | export const toc = []; 4 | 5 | export default function* ( 6 | data: Lume.Data, 7 | ) { 8 | yield { 9 | url: `/examples/`, 10 | title: `Deno examples and tutorials`, 11 | content: , 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /examples/scripts/deno_version.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title Getting the Deno version 3 | * @difficulty beginner 4 | * @tags cli 5 | * @run 6 | * @resource {https://docs.deno.com/api/deno/~/Deno.version} Doc: Deno.version 7 | * @group CLI 8 | * 9 | * How to examine the version of Deno being used. 10 | */ 11 | 12 | // To print the current version of Deno, just reach into the Deno global object 13 | // where all non-web-standard APIs reside. 14 | console.log("Current Deno version", Deno.version.deno); 15 | 16 | // Deno has two main dependencies: the V8 JavaScript engine (from the Chrome web 17 | // browser) and the TypeScript compiler. The versions of these are also 18 | // accessible in the `Deno.version` object. 19 | console.log("Current TypeScript version", Deno.version.typescript); 20 | console.log("Current V8 version", Deno.version.v8); 21 | -------------------------------------------------------------------------------- /examples/scripts/hello_world.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title Hello world 3 | * @difficulty beginner 4 | * @tags cli, deploy, web 5 | * @run 6 | * @resource {https://docs.deno.com/runtime/manual/getting_started/installation} Deno: Installation 7 | * @resource {https://docs.deno.com/runtime/manual/getting_started/setup_your_environment} Manual: Set up your environment 8 | * @group Basics 9 | * @sortOrder 0 10 | * The one and only line in this program will print "Hello, World!" to the console. Run this file with the Deno CLI and the run command. 11 | */ 12 | 13 | // Log "Hello, World!" to the console. 14 | console.log("Hello, World!"); 15 | -------------------------------------------------------------------------------- /examples/scripts/hono.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title Hono HTTP server 3 | * @difficulty intermediate 4 | * @tags cli, deploy 5 | * @run -N 6 | * @resource {https://jsr.io/@hono/hono} Hono on jsr.io 7 | * @resource {https://hono.dev/docs} Hono documentation 8 | * @group Network 9 | * 10 | * An example of a HTTP server that uses the Hono framework. 11 | */ 12 | 13 | // Import the Hono framework 14 | import { Hono } from "jsr:@hono/hono"; 15 | 16 | // Create a new Hono server 17 | const app = new Hono(); 18 | 19 | // Define a route that responds with "Hello, World!" 20 | // The first argument is the path, the second is the request handler 21 | app.get("/", (c) => c.text("Hello, World!")); 22 | 23 | // Call Deno.serve with the request handler to start the server on the default port (8000) 24 | Deno.serve(app.fetch); 25 | 26 | // Test the server with: curl http://localhost:8000 27 | // Should output "Hello, World!" 28 | 29 | // Read more about Hono with Deno at https://hono.dev/docs/getting-started/deno 30 | -------------------------------------------------------------------------------- /examples/scripts/http_server.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title HTTP Server: Hello world 3 | * @difficulty intermediate 4 | * @tags cli, deploy 5 | * @run -N 6 | * @resource {https://docs.deno.com/api/deno/~/Deno.serve} Doc: Deno.serve 7 | * @resource {https://developer.mozilla.org/en-US/docs/Web/API/Response} MDN: Response 8 | * @playground https://dash.deno.com/playground/example-helloworld 9 | * @group Network 10 | * 11 | * An example of a HTTP server that serves a "Hello World" message. 12 | */ 13 | 14 | // HTTP servers need a handler function. This function is called for every 15 | // request that comes in. It must return a `Response`. The handler function can 16 | // be asynchronous (it may return a `Promise`). 17 | function handler(_req: Request): Response { 18 | return new Response("Hello, World!"); 19 | } 20 | 21 | // To start the server on the default port, call `Deno.serve` with the handler. 22 | Deno.serve(handler); 23 | -------------------------------------------------------------------------------- /examples/scripts/importing_json.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title Importing JSON 3 | * @difficulty beginner 4 | * @tags cli, web 5 | * @run 6 | * @group Encoding 7 | * 8 | * JSON files can be imported in JS and TS files using the `import` keyword. 9 | * This makes including static data in a library much easier. 10 | */ 11 | 12 | // File: ./main.ts 13 | 14 | // JSON files can be imported in JS and TS modules. When doing so, you need to 15 | // specify the "json" import assertion type. 16 | import file from "./version.json" with { type: "json" }; 17 | console.log(file.version); 18 | 19 | // Dynamic imports are also supported. 20 | const module = await import("./version.json", { 21 | with: { type: "json" }, 22 | }); 23 | console.log(module.default.version); 24 | 25 | /* File: ./version.json 26 | { 27 | "version": "1.0.0" 28 | } 29 | */ 30 | -------------------------------------------------------------------------------- /examples/scripts/node_built_in.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title Use Node.js built-in modules 3 | * @difficulty beginner 4 | * @tags cli, deploy 5 | * @run -E 6 | * @resource {https://docs.deno.com/runtime/fundamentals/node} Node.js / npm support in Deno 7 | * @resource {https://docs.deno.com/runtime/fundamentals/node/#node_specifiers} node: specifiers 8 | * @group Basics 9 | * 10 | * Deno supports most built-in Node.js modules natively - you can include them 11 | * in your code using "node:" specifiers in your imports. 12 | */ 13 | 14 | // Import the os module from core Node to get operating system info 15 | import os from "node:os"; 16 | 17 | // Use the module as you would in Node.js 18 | console.log("Current architecture is:", os.arch()); 19 | console.log("Home directory is:", os.homedir()); 20 | -------------------------------------------------------------------------------- /examples/scripts/pid.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title Process information 3 | * @difficulty beginner 4 | * @tags cli 5 | * @run 6 | * @group System 7 | */ 8 | 9 | // The current process's process ID is available in the `Deno.pid` variable. 10 | console.log(Deno.pid); 11 | 12 | // The parent process ID is available in the Deno namespace too. 13 | console.log(Deno.ppid); 14 | -------------------------------------------------------------------------------- /examples/scripts/postgres.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title Connect to Postgres 3 | * @difficulty intermediate 4 | * @tags cli, deploy 5 | * @run -N -E 6 | * @group Databases 7 | * 8 | * Using the npm Postgres client, you can connect to a Postgres database 9 | * running anywhere. 10 | */ 11 | 12 | // Import the Postgres package from 13 | import postgres from "npm:postgres"; 14 | 15 | // Initialize the client with connection information for your database, and 16 | // create a connection. 17 | const sql = postgres({ 18 | user: "user", 19 | database: "test", 20 | hostname: "localhost", 21 | port: 5432, 22 | }); 23 | 24 | // Execute a SQL query 25 | const result = await sql` 26 | SELECT ID, NAME FROM PEOPLE 27 | `; 28 | console.log(result); 29 | 30 | // Close the connection to the database 31 | await sql.end(); 32 | -------------------------------------------------------------------------------- /examples/scripts/tcp_connector.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title TCP connector: Ping 3 | * @difficulty intermediate 4 | * @tags cli 5 | * @run -N 6 | * @resource {https://docs.deno.com/api/deno/~/Deno.connect} Doc: Deno.connect 7 | * @resource {/examples/tcp_listener} Example: TCP Listener 8 | * @group Network 9 | * 10 | * An example of connecting to a TCP server on localhost and writing a 'ping' message to the server. 11 | */ 12 | 13 | // Instantiate an instance of text encoder to write to the TCP stream. 14 | const encoder = new TextEncoder(); 15 | // Establish a connection to our TCP server that is currently being run on localhost port 8080. 16 | const conn = await Deno.connect({ 17 | hostname: "127.0.0.1", 18 | port: 8080, 19 | transport: "tcp", 20 | }); 21 | // Encode the 'ping' message and write to the TCP connection for the server to receive. 22 | await conn.write(encoder.encode("ping")); 23 | -------------------------------------------------------------------------------- /examples/scripts/tls_listener.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title TCP/TLS listener: Ping 3 | * @difficulty intermediate 4 | * @tags cli 5 | * @run -N -R 6 | * @resource {https://docs.deno.com/api/deno/~/Deno.listenTls} Doc: Deno.listenTls 7 | * @group Network 8 | * 9 | * An example of a TCP listener using TLS on localhost that will log the message if written to and close the connection if connected to. 10 | */ 11 | 12 | // Instantiate an instance of a TCP listener on localhost port 443. 13 | const listener = Deno.listenTls({ 14 | hostname: "127.0.0.1", 15 | port: 443, 16 | transport: "tcp", 17 | cert: Deno.readTextFileSync("./server.crt"), 18 | key: Deno.readTextFileSync("./server.key"), 19 | }); 20 | 21 | // Await asynchronous connections that are established to our TCP listener. 22 | for await (const conn of listener) { 23 | // Pipe the contents of the TCP stream into stdout 24 | await conn.readable.pipeTo(Deno.stdout.writable); 25 | 26 | // We close the connection that was established. 27 | conn.close(); 28 | } 29 | -------------------------------------------------------------------------------- /examples/scripts/typescript_support.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title Built-in TypeScript support 3 | * @difficulty beginner 4 | * @tags cli, deploy 5 | * @run 6 | * @resource {https://www.typescriptlang.org/docs/handbook/intro.html} TypeScript handbook 7 | * @group Basics 8 | * 9 | * Deno natively understands TypeScript code with no compiler to configure. 10 | * Start writing code in .ts files, and the runtime will work with them just 11 | * fine. 12 | */ 13 | 14 | // Define an interface in TypeScript 15 | interface Person { 16 | name: string; 17 | age: number; 18 | } 19 | 20 | // Provide a typed input to a function 21 | function greet(person: Person) { 22 | return "Hello, " + person.name + "!"; 23 | } 24 | 25 | // Everything works with zero config! 26 | console.log(greet({ name: "Alice", age: 36 })); 27 | -------------------------------------------------------------------------------- /examples/scripts/unzip_gzipped_file.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @title Unzip gzipped file 3 | * @difficulty beginner 4 | * @tags cli, deploy 5 | * @run -W -R 6 | * @group File System 7 | * 8 | * An example of how to decompress a gzipped file and save it to disk. 9 | */ 10 | 11 | // Open the gzipped file for reading 12 | const file = await Deno.open("large_file.json.gz"); 13 | 14 | // Create a new file to write the decompressed data 15 | const outputPath = await Deno.create("large_file.json"); 16 | 17 | // Get the writable stream of the output file 18 | const writableStream = outputPath.writable; 19 | 20 | // Create a decompression stream for gzip format 21 | const stream = new DecompressionStream("gzip"); 22 | 23 | // Pipe the readable stream of the gzipped file through the decompression stream and then to the writable stream of the output file 24 | file.readable.pipeThrough(stream).pipeTo(writableStream); 25 | -------------------------------------------------------------------------------- /examples/tutorials/images/deno-educator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/deno-educator.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/astro/dynamic-page.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/astro/dynamic-page.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/astro/hello-astro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/astro/hello-astro.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/astro/index-page.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/astro/index-page.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/aws-lightsail/create-container-service-on-aws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/aws-lightsail/create-container-service-on-aws.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/aws-lightsail/hello-world-from-deno-and-aws-lightsail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/aws-lightsail/hello-world-from-deno-and-aws-lightsail.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/aws-lightsail/hello-world-from-localhost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/aws-lightsail/hello-world-from-localhost.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/aws-lightsail/new-image-on-docker-hub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/aws-lightsail/new-image-on-docker-hub.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/cloudflare-workers/main-on-cloudflare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/cloudflare-workers/main-on-cloudflare.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/digital-ocean/hello-from-deno-and-digital-ocean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/digital-ocean/hello-from-deno-and-digital-ocean.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/digital-ocean/hello-world-from-localhost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/digital-ocean/hello-world-from-localhost.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/digital-ocean/new-deno-image-on-digital-ocean-container-registry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/digital-ocean/new-deno-image-on-digital-ocean-container-registry.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/drizzle/table-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/drizzle/table-diagram.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/google-cloud-run/hello-from-google-cloud-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/google-cloud-run/hello-from-google-cloud-run.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/google-cloud-run/hello-world-from-localhost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/google-cloud-run/hello-world-from-localhost.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/google-cloud-run/image-in-google-artifact-registry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/google-cloud-run/image-in-google-artifact-registry.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/google-cloud-run/new-repository-in-google-artifact-repository.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/google-cloud-run/new-repository-in-google-artifact-repository.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/grafana/grafana-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/grafana/grafana-1.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/grafana/grafana-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/grafana/grafana-2.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/grafana/grafana-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/grafana/grafana-3.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/grafana/grafana-logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/grafana/grafana-logs.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/grafana/grafana-traces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/grafana/grafana-traces.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/grafana/propagation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/grafana/propagation.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/honeycomb/honeycomb-1.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/honeycomb/honeycomb-1.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/honeycomb/honeycomb-2.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/honeycomb/honeycomb-2.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/honeycomb/honeycomb-3.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/honeycomb/honeycomb-3.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/honeycomb/honeycomb-4.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/honeycomb/honeycomb-4.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/hyperdx/hyperdx-1.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/hyperdx/hyperdx-1.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/hyperdx/hyperdx-2.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/hyperdx/hyperdx-2.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/hyperdx/hyperdx-3.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/hyperdx/hyperdx-3.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/hyperdx/hyperdx-4.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/hyperdx/hyperdx-4.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/next/dinoapp.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/next/dinoapp.gif -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/nuxt/nuxt-1.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/nuxt/nuxt-1.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/nuxt/nuxt-2.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/nuxt/nuxt-2.webp -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/nuxt/nuxt-3.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/nuxt/nuxt-3.mp4 -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/nuxt/nuxt-4.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/nuxt/nuxt-4.mp4 -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/prisma/1-dinosaurs-in-prisma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/prisma/1-dinosaurs-in-prisma.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/prisma/2-dinosaurs-from-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/prisma/2-dinosaurs-from-api.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/prisma/3-new-dinosaur-in-prisma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/prisma/3-new-dinosaur-in-prisma.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/qwik/demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/qwik/demo.mp4 -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/react/react-dinosaur-app-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/react/react-dinosaur-app-demo.gif -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/redis/cached-redis-body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/redis/cached-redis-body.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/redis/cached-redis-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/redis/cached-redis-header.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/redis/uncached-redis-body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/redis/uncached-redis-body.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/redis/uncached-redis-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/redis/uncached-redis-header.png -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/solidjs/demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/solidjs/demo.mp4 -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/tanstack/demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/tanstack/demo.mp4 -------------------------------------------------------------------------------- /examples/tutorials/images/how-to/vue/vue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/how-to/vue/vue.gif -------------------------------------------------------------------------------- /examples/tutorials/images/quick-fix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/quick-fix.png -------------------------------------------------------------------------------- /examples/tutorials/images/websockets.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/websockets.gif -------------------------------------------------------------------------------- /examples/tutorials/images/word_finder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/examples/tutorials/images/word_finder.png -------------------------------------------------------------------------------- /examples/videos/deno_test.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Getting started with Deno test" 3 | url: /examples/deno_test/ 4 | videoUrl: https://www.youtube.com/watch?v=gDtDVfsgHgs 5 | layout: video.tsx 6 | --- 7 | -------------------------------------------------------------------------------- /examples/videos/esmodules.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "ECMAScript Modules" 3 | url: /examples/esmodules/ 4 | videoUrl: https://www.youtube.com/watch?v=cTFBiwYY3vs&list=PLvvLnBDNuTEov9EBIp3MMfHlBxaKGRWTe&index=9 5 | layout: video.tsx 6 | --- 7 | -------------------------------------------------------------------------------- /examples/videos/mongoose.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Connect to Mongoose and MongoDB" 3 | url: /examples/mongoose/ 4 | videoUrl: https://www.youtube.com/watch?v=dmZ9Ih0CR9g 5 | layout: video.tsx 6 | --- 7 | -------------------------------------------------------------------------------- /examples/videos/prisma.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Connect to Prisma" 3 | url: /examples/prisma/ 4 | videoUrl: https://www.youtube.com/watch?v=P8VzA_XSF8w 5 | layout: video.tsx 6 | --- 7 | -------------------------------------------------------------------------------- /examples/videos/react_app_video.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Build a React app" 3 | url: /examples/react_app_video/ 4 | videoUrl: https://www.youtube.com/watch?v=eStwt_2THd8 5 | layout: video.tsx 6 | --- 7 | -------------------------------------------------------------------------------- /examples/videos/realtime_websocket_app.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Build a Realtime WebSocket Application" 3 | url: /examples/realtime_websocket_app/ 4 | videoUrl: https://www.youtube.com/watch?v=FC4IrkHEg4A&list=PLvvLnBDNuTEov9EBIp3MMfHlBxaKGRWTe&index=15 5 | layout: video.tsx 6 | --- 7 | -------------------------------------------------------------------------------- /examples/videos/ts_jsx.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "TypeScript and JSX" 3 | url: /examples/ts_jsx/ 4 | videoUrl: https://www.youtube.com/watch?v=KoM8ahe8O74&list=PLvvLnBDNuTEov9EBIp3MMfHlBxaKGRWTe&index=11 5 | layout: video.tsx 6 | --- 7 | -------------------------------------------------------------------------------- /examples/videos/vue_app_video.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Build a Vue app" 3 | url: /examples/vue_app_video/ 4 | videoUrl: https://www.youtube.com/watch?v=MDPauM8fZDE 5 | layout: video.tsx 6 | --- 7 | -------------------------------------------------------------------------------- /lint/rules/ban-ts-comment.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use of Typescript directives without a comment. 6 | 7 | Typescript directives reduce the effectiveness of the compiler, something which 8 | should only be done in exceptional circumstances. The reason why should be 9 | documented in a comment alongside the directive. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | // @ts-expect-error 15 | let a: number = "I am a string"; 16 | ``` 17 | 18 | ```typescript 19 | // @ts-ignore 20 | let a: number = "I am a string"; 21 | ``` 22 | 23 | ```typescript 24 | // @ts-nocheck 25 | let a: number = "I am a string"; 26 | ``` 27 | 28 | **Valid:** 29 | 30 | ```typescript 31 | // @ts-expect-error: Temporary workaround (see ticket #422) 32 | let a: number = "I am a string"; 33 | ``` 34 | 35 | ```typescript 36 | // @ts-ignore: Temporary workaround (see ticket #422) 37 | let a: number = "I am a string"; 38 | ``` 39 | 40 | ```typescript 41 | // @ts-nocheck: Temporary workaround (see ticket #422) 42 | let a: number = "I am a string"; 43 | ``` 44 | -------------------------------------------------------------------------------- /lint/rules/ban-unknown-rule-code.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Warns the usage of unknown rule codes in ignore directives. 6 | 7 | We sometimes have to suppress and ignore lint errors for some reasons. We can do 8 | so using [ignore directives](/go/lint-ignore/) with rule names that should be 9 | ignored like so: 10 | 11 | ```typescript 12 | // deno-lint-ignore no-explicit-any no-unused-vars 13 | const foo: any = 42; 14 | ``` 15 | 16 | This rule checks for the validity of the specified rule names (i.e. whether 17 | `deno_lint` provides the rule or not). 18 | 19 | **Invalid:** 20 | 21 | ```typescript 22 | // typo 23 | // deno-lint-ignore eq-eq-e 24 | console.assert(x == 42); 25 | 26 | // unknown rule name 27 | // deno-lint-ignore UNKNOWN_RULE_NAME 28 | const b = "b"; 29 | ``` 30 | 31 | **Valid:** 32 | 33 | ```typescript 34 | // deno-lint-ignore eq-eq-eq 35 | console.assert(x == 42); 36 | 37 | // deno-lint-ignore no-unused-vars 38 | const b = "b"; 39 | ``` 40 | -------------------------------------------------------------------------------- /lint/rules/ban-untagged-ignore.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Requires `deno-lint-ignore` to be annotated with one or more rule names. 6 | 7 | Ignoring all rules can mask unexpected or future problems. Therefore you need to 8 | explicitly specify which rule(s) are to be ignored. 9 | 10 | **Invalid:** 11 | 12 | ```typescript 13 | // deno-lint-ignore 14 | export function duplicateArgumentsFn(a, b, a) {} 15 | ``` 16 | 17 | **Valid:** 18 | 19 | ```typescript 20 | // deno-lint-ignore no-dupe-args 21 | export function duplicateArgumentsFn(a, b, a) {} 22 | ``` 23 | -------------------------------------------------------------------------------- /lint/rules/ban-unused-ignore.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Warns unused ignore directives. 6 | 7 | We sometimes have to suppress and ignore lint errors for some reasons and we can 8 | do so using [ignore directives](/go/lint-ignore/). 9 | 10 | In some cases, however, like after refactoring, we may end up having ignore 11 | directives that are no longer necessary. Such superfluous ignore directives are 12 | likely to confuse future code readers, and to make matters worse, might hide 13 | future lint errors unintentionally. To prevent such situations, this rule 14 | detects unused, superfluous ignore directives. 15 | 16 | **Invalid:** 17 | 18 | ```typescript 19 | // Actually this line is valid since `export` means "used", 20 | // so this directive is superfluous 21 | // deno-lint-ignore no-unused-vars 22 | export const foo = 42; 23 | ``` 24 | 25 | **Valid:** 26 | 27 | ```typescript 28 | export const foo = 42; 29 | ``` 30 | -------------------------------------------------------------------------------- /lint/rules/button-has-type.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Checks that a `; 13 | const btn = ; 14 | ``` 15 | 16 | **Valid:** 17 | 18 | ```tsx 19 | const btn = ; 20 | const btn = ; 21 | const btn = ; 22 | const btn = ; 23 | ``` 24 | -------------------------------------------------------------------------------- /lint/rules/jsx-curly-braces.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended, react, jsx] 3 | --- 4 | 5 | Ensure consistent use of curly braces around JSX expressions. 6 | 7 | **Invalid:** 8 | 9 | ```tsx 10 | const foo = />; 11 | const foo = ; 12 | const foo =
    {"foo"}
    ; 13 | ``` 14 | 15 | **Valid:** 16 | 17 | ```tsx 18 | const foo = } />; 19 | const foo = ; 20 | const foo =
    foo
    ; 21 | ``` 22 | -------------------------------------------------------------------------------- /lint/rules/jsx-key.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended, react, jsx] 3 | --- 4 | 5 | Ensure the `key` attribute is present when passing iterables into JSX. It allows 6 | frameworks to optimize checking the order of elements. 7 | 8 | **Invalid:** 9 | 10 | ```tsx 11 | const foo = [
    foo
    ]; 12 | const foo = [<>foo]; 13 | [1, 2, 3].map(() =>
    ); 14 | Array.from([1, 2, 3], () =>
    ); 15 | ``` 16 | 17 | **Valid:** 18 | 19 | ```tsx 20 | const foo = [
    foo
    ]; 21 | const foo = [foo]; 22 | [1, 2, 3].map((x) =>
    ); 23 | Array.from([1, 2, 3], (x) =>
    ); 24 | ``` 25 | -------------------------------------------------------------------------------- /lint/rules/jsx-no-children-prop.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended, react, jsx, fresh] 3 | --- 4 | 5 | Pass children as JSX children instead of as an attribute. 6 | 7 | **Invalid:** 8 | 9 | ```tsx 10 |
    11 |
    , ]} /> 12 | ``` 13 | 14 | **Valid:** 15 | 16 | ```tsx 17 |
    foo
    18 |
    19 | ``` 20 | -------------------------------------------------------------------------------- /lint/rules/jsx-no-comment-text-nodes.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended, react, jsx, fresh] 3 | --- 4 | 5 | JavaScript comments inside text nodes are rendered as plain text in JSX. This is 6 | often unexpected. 7 | 8 | **Invalid:** 9 | 10 | ```tsx 11 |
    // comment
    12 |
    /* comment */
    13 | ``` 14 | 15 | **Valid:** 16 | 17 | ```tsx 18 |
    {/* comment */}
    ; 19 | ``` 20 | -------------------------------------------------------------------------------- /lint/rules/jsx-no-duplicate-props.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended, react, jsx] 3 | --- 4 | 5 | Disallow duplicated JSX props. Later props will always overwrite earlier props 6 | often leading to unexpected results. 7 | 8 | **Invalid:** 9 | 10 | ```tsx 11 |
    ; 12 | ; 13 | ; 14 | ``` 15 | 16 | **Valid:** 17 | 18 | ```tsx 19 |
    20 | 21 | 22 | 23 | ``` 24 | -------------------------------------------------------------------------------- /lint/rules/jsx-no-unescaped-entities.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended, react, jsx, fresh] 3 | --- 4 | 5 | Leaving the `>` or `}` character in JSX is often undesired and difficult to 6 | spot. Enforce that these characters must be passed as strings. 7 | 8 | **Invalid:** 9 | 10 | ```tsx 11 |
    >
    12 |
    }
    13 | ``` 14 | 15 | **Valid:** 16 | 17 | ```tsx 18 |
    >
    , 19 |
    {">"}
    , 20 |
    {"}"}
    , 21 | ``` 22 | -------------------------------------------------------------------------------- /lint/rules/jsx-no-useless-fragment.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended, react, jsx, fresh] 3 | --- 4 | 5 | Fragments are only necessary at the top of a JSX "block" and only when there are 6 | multiple children. Fragments are not needed in other scenarios. 7 | 8 | **Invalid:** 9 | 10 | ```tsx 11 | <> 12 | <>
    13 | <> 14 |

    foo <>bar

    15 | ``` 16 | 17 | **Valid:** 18 | 19 | ```tsx 20 | <>{foo} 21 | <>
    22 | <>foo
    23 |

    foo bar

    24 | ``` 25 | -------------------------------------------------------------------------------- /lint/rules/jsx-props-no-spread-multi.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended, react, jsx] 3 | --- 4 | 5 | Spreading the same expression twice is typically a mistake and causes 6 | unnecessary computations. 7 | 8 | **Invalid:** 9 | 10 | ```tsx 11 |
    12 |
    13 | 14 | ``` 15 | 16 | **Valid:** 17 | 18 | ```tsx 19 |
    20 |
    21 | 22 | ``` 23 | -------------------------------------------------------------------------------- /lint/rules/jsx-void-dom-elements-no-children.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended, react, jsx, fresh] 3 | --- 4 | 5 | Ensure that void elements in HTML don't have any children as that is not valid 6 | HTML. See 7 | [`Void element` article on MDN](https://developer.mozilla.org/en-US/docs/Glossary/Void_element) 8 | for more information. 9 | 10 | **Invalid:** 11 | 12 | ```tsx 13 |
    foo
    14 | foo 15 | ``` 16 | 17 | **Valid:** 18 | 19 | ```tsx 20 |
    21 | 22 | ``` 23 | -------------------------------------------------------------------------------- /lint/rules/no-await-in-sync-fn.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallow `await` keyword inside a non-async function. 6 | 7 | Using the `await` keyword inside a non-async function is a syntax error. To be 8 | able to use `await` inside a function, the function needs to be marked as async 9 | via the `async` keyword. 10 | 11 | **Invalid:** 12 | 13 | ```javascript 14 | function foo() { 15 | await bar(); 16 | } 17 | 18 | const fooFn = function foo() { 19 | await bar(); 20 | }; 21 | 22 | const fooFn = () => { 23 | await bar(); 24 | }; 25 | ``` 26 | 27 | **Valid:** 28 | 29 | ```javascript 30 | async function foo() { 31 | await bar(); 32 | } 33 | 34 | const fooFn = async function foo() { 35 | await bar(); 36 | }; 37 | 38 | const fooFn = async () => { 39 | await bar(); 40 | }; 41 | ``` 42 | -------------------------------------------------------------------------------- /lint/rules/no-class-assign.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows modifying variables of class declarations. 6 | 7 | Declaring a class such as `class A {}`, creates a variable `A`. Like any 8 | variable this can be modified or reassigned. In most cases this is a mistake and 9 | not what was intended. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | class A {} 15 | A = 0; // reassigning the class variable itself 16 | ``` 17 | 18 | **Valid:** 19 | 20 | ```typescript 21 | class A {} 22 | let c = new A(); 23 | c = 0; // reassigning the variable `c` 24 | ``` 25 | -------------------------------------------------------------------------------- /lint/rules/no-compare-neg-zero.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows comparing against negative zero (`-0`). 6 | 7 | Comparing a value directly against negative may not work as expected as it will 8 | also pass for non-negative zero (i.e. `0` and `+0`). Explicit comparison with 9 | negative zero can be performed using `Object.is`. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | if (x === -0) {} 15 | ``` 16 | 17 | **Valid:** 18 | 19 | ```typescript 20 | if (x === 0) {} 21 | 22 | if (Object.is(x, -0)) {} 23 | ``` 24 | -------------------------------------------------------------------------------- /lint/rules/no-cond-assign.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use of the assignment operator, `=`, in conditional statements. 6 | 7 | Use of the assignment operator within a conditional statement is often the 8 | result of mistyping the equality operator, `==`. If an assignment within a 9 | conditional statement is required then this rule allows it by wrapping the 10 | assignment in parentheses. 11 | 12 | **Invalid:** 13 | 14 | ```typescript 15 | let x; 16 | if (x = 0) { 17 | let b = 1; 18 | } 19 | ``` 20 | 21 | ```typescript 22 | function setHeight(someNode) { 23 | do { 24 | someNode.height = "100px"; 25 | } while (someNode = someNode.parentNode); 26 | } 27 | ``` 28 | 29 | **Valid:** 30 | 31 | ```typescript 32 | let x; 33 | if (x === 0) { 34 | let b = 1; 35 | } 36 | ``` 37 | 38 | ```typescript 39 | function setHeight(someNode) { 40 | do { 41 | someNode.height = "100px"; 42 | } while ((someNode = someNode.parentNode)); 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /lint/rules/no-const-assign.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallows modifying a variable declared as `const`. 6 | 7 | Modifying a variable declared as `const` will result in a runtime error. 8 | 9 | **Invalid:** 10 | 11 | ```typescript 12 | const a = 0; 13 | a = 1; 14 | a += 1; 15 | a++; 16 | ++a; 17 | ``` 18 | 19 | **Valid:** 20 | 21 | ```typescript 22 | const a = 0; 23 | const b = a + 1; 24 | 25 | // `c` is out of scope on each loop iteration, allowing a new assignment 26 | for (const c in [1, 2, 3]) {} 27 | ``` 28 | -------------------------------------------------------------------------------- /lint/rules/no-constant-condition.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use of a constant expression in conditional test. 6 | 7 | Using a constant expression in a conditional test is often either a mistake or a 8 | temporary situation introduced during development and is not ready for 9 | production. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | if (true) {} 15 | if (2) {} 16 | do {} while (x = 2); // infinite loop 17 | ``` 18 | 19 | **Valid:** 20 | 21 | ```typescript 22 | if (x) {} 23 | if (x === 0) {} 24 | do {} while (x === 2); 25 | ``` 26 | -------------------------------------------------------------------------------- /lint/rules/no-control-regex.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use ASCII control characters in regular expressions. 6 | 7 | Control characters are invisible characters in the ASCII range of 0-31. It is 8 | uncommon to use these in a regular expression and more often it is a mistake in 9 | the regular expression. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | // Examples using ASCII (31) Carriage Return (hex x0d) 15 | const pattern1 = /\x0d/; 16 | const pattern2 = /\u000d/; 17 | const pattern3 = new RegExp("\\x0d"); 18 | const pattern4 = new RegExp("\\u000d"); 19 | ``` 20 | 21 | **Valid:** 22 | 23 | ```typescript 24 | // Examples using ASCII (32) Space (hex x20) 25 | const pattern1 = /\x20/; 26 | const pattern2 = /\u0020/; 27 | const pattern3 = new RegExp("\\x20"); 28 | const pattern4 = new RegExp("\\u0020"); 29 | ``` 30 | -------------------------------------------------------------------------------- /lint/rules/no-debugger.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use of the `debugger` statement. 6 | 7 | `debugger` is a statement which is meant for stopping the javascript execution 8 | environment and start the debugger at the statement. Modern debuggers and 9 | tooling no longer need this statement and leaving it in can cause the execution 10 | of your code to stop in production. 11 | 12 | **Invalid:** 13 | 14 | ```typescript 15 | function isLongString(x: string) { 16 | debugger; 17 | return x.length > 100; 18 | } 19 | ``` 20 | 21 | **Valid:** 22 | 23 | ```typescript 24 | function isLongString(x: string) { 25 | return x.length > 100; // set breakpoint here instead 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /lint/rules/no-delete-var.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the deletion of variables. 6 | 7 | `delete` is used to remove a property from an object. Variables declared via 8 | `var`, `let` and `const` cannot be deleted (`delete` will return `false`). 9 | Setting `strict` mode on will raise a syntax error when attempting to delete a 10 | variable. 11 | 12 | **Invalid:** 13 | 14 | ```typescript 15 | const a = 1; 16 | let b = 2; 17 | let c = 3; 18 | delete a; // would return false 19 | delete b; // would return false 20 | delete c; // would return false 21 | ``` 22 | 23 | **Valid:** 24 | 25 | ```typescript 26 | let obj = { 27 | a: 1, 28 | }; 29 | delete obj.a; // return true 30 | ``` 31 | -------------------------------------------------------------------------------- /lint/rules/no-dupe-args.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows using an argument name more than once in a function signature. 6 | 7 | If you supply multiple arguments of the same name to a function, the last 8 | instance will shadow the preceding one(s). This is most likely an unintentional 9 | typo. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | function withDupes(a, b, a) { 15 | console.log("I'm the value of the second a:", a); 16 | } 17 | ``` 18 | 19 | **Valid:** 20 | 21 | ```typescript 22 | function withoutDupes(a, b, c) { 23 | console.log("I'm the value of the first (and only) a:", a); 24 | } 25 | ``` 26 | -------------------------------------------------------------------------------- /lint/rules/no-dupe-class-members.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows using a class member function name more than once. 6 | 7 | Declaring a function of the same name twice in a class will cause the previous 8 | declaration(s) to be overwritten, causing unexpected behaviors. 9 | 10 | **Invalid:** 11 | 12 | ```typescript 13 | class Foo { 14 | bar() {} 15 | bar() {} 16 | } 17 | ``` 18 | 19 | **Valid:** 20 | 21 | ```typescript 22 | class Foo { 23 | bar() {} 24 | fizz() {} 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /lint/rules/no-dupe-else-if.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows using the same condition twice in an `if`/`else if` statement. 6 | 7 | When you reuse a condition in an `if`/`else if` statement, the duplicate 8 | condition will never be reached (without unusual side-effects) meaning this is 9 | almost always a bug. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | if (a) {} 15 | else if (b) {} 16 | else if (a) {} // duplicate of condition above 17 | 18 | if (a === 5) {} 19 | else if (a === 6) {} 20 | else if (a === 5) {} // duplicate of condition above 21 | ``` 22 | 23 | **Valid:** 24 | 25 | ```typescript 26 | if (a) {} 27 | else if (b) {} 28 | else if (c) {} 29 | 30 | if (a === 5) {} 31 | else if (a === 6) {} 32 | else if (a === 7) {} 33 | ``` 34 | -------------------------------------------------------------------------------- /lint/rules/no-dupe-keys.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows duplicate keys in object literals. 6 | 7 | Setting the same key multiple times in an object literal will override other 8 | assignments to that key and can cause unexpected behaviour. 9 | 10 | **Invalid:** 11 | 12 | ```typescript 13 | const foo = { 14 | bar: "baz", 15 | bar: "qux", 16 | }; 17 | ``` 18 | 19 | ```typescript 20 | const foo = { 21 | "bar": "baz", 22 | bar: "qux", 23 | }; 24 | ``` 25 | 26 | ```typescript 27 | const foo = { 28 | 0x1: "baz", 29 | 1: "qux", 30 | }; 31 | ``` 32 | 33 | **Valid:** 34 | 35 | ```typescript 36 | const foo = { 37 | bar: "baz", 38 | quxx: "qux", 39 | }; 40 | ``` 41 | -------------------------------------------------------------------------------- /lint/rules/no-duplicate-case.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows using the same case clause in a switch statement more than once. 6 | 7 | When you reuse a case test expression in a `switch` statement, the duplicate 8 | case will never be reached meaning this is almost always a bug. 9 | 10 | **Invalid:** 11 | 12 | ```typescript 13 | const someText = "a"; 14 | switch (someText) { 15 | case "a": // (1) 16 | break; 17 | case "b": 18 | break; 19 | case "a": // duplicate of (1) 20 | break; 21 | default: 22 | break; 23 | } 24 | ``` 25 | 26 | **Valid:** 27 | 28 | ```typescript 29 | const someText = "a"; 30 | switch (someText) { 31 | case "a": 32 | break; 33 | case "b": 34 | break; 35 | case "c": 36 | break; 37 | default: 38 | break; 39 | } 40 | ``` 41 | -------------------------------------------------------------------------------- /lint/rules/no-empty-character-class.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows using the empty character class in a regular expression. 6 | 7 | Regular expression character classes are a series of characters in brackets, 8 | e.g. `[abc]`. if nothing is supplied in the brackets it will not match anything 9 | which is likely a typo or mistake. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | /^abc[]/.test("abcdefg"); // false, as `d` does not match an empty character class 15 | "abcdefg".match(/^abc[]/); // null 16 | ``` 17 | 18 | **Valid:** 19 | 20 | ```typescript 21 | // Without a character class 22 | /^abc/.test("abcdefg"); // true 23 | "abcdefg".match(/^abc/); // ["abc"] 24 | 25 | // With a valid character class 26 | /^abc[a-z]/.test("abcdefg"); // true 27 | "abcdefg".match(/^abc[a-z]/); // ["abcd"] 28 | ``` 29 | -------------------------------------------------------------------------------- /lint/rules/no-empty-enum.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the declaration of an empty enum. 6 | 7 | An enum with no members serves no purpose. This rule will capture these 8 | situations as either unnecessary code or a mistaken empty implementation. 9 | 10 | **Invalid:** 11 | 12 | ```typescript 13 | enum Foo {} 14 | ``` 15 | 16 | **Valid:** 17 | 18 | ```typescript 19 | enum Foo { 20 | ONE = "ONE", 21 | } 22 | ``` 23 | -------------------------------------------------------------------------------- /lint/rules/no-empty-interface.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the declaration of an empty interface. 6 | 7 | An interface with no members serves no purpose. This rule will capture these 8 | situations as either unnecessary code or a mistaken empty implementation. 9 | 10 | **Invalid:** 11 | 12 | ```typescript 13 | interface Foo {} 14 | ``` 15 | 16 | **Valid:** 17 | 18 | ```typescript 19 | interface Foo { 20 | name: string; 21 | } 22 | 23 | interface Bar { 24 | age: number; 25 | } 26 | 27 | // Using an empty interface with at least one extension are allowed. 28 | 29 | // Using an empty interface to change the identity of Baz from type to interface. 30 | type Baz = { profession: string }; 31 | interface Foo extends Baz {} 32 | 33 | // Using an empty interface to extend already existing Foo declaration 34 | // with members of the Bar interface 35 | interface Foo extends Bar {} 36 | 37 | // Using an empty interface as a union type 38 | interface Baz extends Foo, Bar {} 39 | ``` 40 | -------------------------------------------------------------------------------- /lint/rules/no-empty.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use of empty block statements. 6 | 7 | Empty block statements are legal but often represent that something was missed 8 | and can make code less readable. This rule ignores block statements that only 9 | contain comments. This rule also ignores empty constructors and function bodies 10 | (including arrow functions). 11 | 12 | **Invalid:** 13 | 14 | ```typescript 15 | if (foo) {} 16 | 17 | while (foo) {} 18 | 19 | switch (foo) {} 20 | 21 | try { 22 | doSomething(); 23 | } catch (e) { 24 | } finally { 25 | } 26 | ``` 27 | 28 | **Valid:** 29 | 30 | ```typescript 31 | if (foo) { 32 | // empty 33 | } 34 | 35 | while (foo) { 36 | /* empty */ 37 | } 38 | 39 | try { 40 | doSomething(); 41 | } catch (e) { 42 | // continue regardless of error 43 | } 44 | 45 | try { 46 | doSomething(); 47 | } finally { 48 | /* continue regardless of error */ 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /lint/rules/no-eval.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallows the use of `eval`. 6 | 7 | `eval` is a potentially dangerous function which can open your code to a number 8 | of security vulnerabilities. In addition to being slow, `eval` is also often 9 | unnecessary with better solutions available. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | const obj = { x: "foo" }; 15 | const key = "x", 16 | const value = eval("obj." + key); 17 | ``` 18 | 19 | **Valid:** 20 | 21 | ```typescript 22 | const obj = { x: "foo" }; 23 | const value = obj[x]; 24 | ``` 25 | -------------------------------------------------------------------------------- /lint/rules/no-ex-assign.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the reassignment of exception parameters. 6 | 7 | There is generally no good reason to reassign an exception parameter. Once 8 | reassigned the code from that point on has no reference to the error anymore. 9 | 10 | **Invalid:** 11 | 12 | ```typescript 13 | try { 14 | someFunc(); 15 | } catch (e) { 16 | e = true; 17 | // can no longer access the thrown error 18 | } 19 | ``` 20 | 21 | **Valid:** 22 | 23 | ```typescript 24 | try { 25 | someFunc(); 26 | } catch (e) { 27 | const anotherVar = true; 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /lint/rules/no-explicit-any.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows use of the `any` type. 6 | 7 | Use of the `any` type disables the type check system around that variable, 8 | defeating the purpose of Typescript which is to provide type safe code. 9 | Additionally, the use of `any` hinders code readability, since it is not 10 | immediately clear what type of value is being referenced. It is better to be 11 | explicit about all types. For a more type-safe alternative to `any`, use 12 | `unknown` if you are unable to choose a more specific type. 13 | 14 | **Invalid:** 15 | 16 | ```typescript 17 | const someNumber: any = "two"; 18 | function foo(): any { 19 | return undefined; 20 | } 21 | ``` 22 | 23 | **Valid:** 24 | 25 | ```typescript 26 | const someNumber: string = "two"; 27 | function foo(): undefined { 28 | return undefined; 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /lint/rules/no-extra-boolean-cast.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows unnecessary boolean casts. 6 | 7 | In certain contexts, such as `if`, `while` or `for` statements, expressions are 8 | automatically coerced into a boolean. Therefore, techniques such as double 9 | negation (`!!foo`) or casting (`Boolean(foo)`) are unnecessary and produce the 10 | same result as without the negation or casting. 11 | 12 | **Invalid:** 13 | 14 | ```typescript 15 | if (!!foo) {} 16 | if (Boolean(foo)) {} 17 | while (!!foo) {} 18 | for (; Boolean(foo);) {} 19 | ``` 20 | 21 | **Valid:** 22 | 23 | ```typescript 24 | if (foo) {} 25 | while (foo) {} 26 | for (; foo;) {} 27 | ``` 28 | -------------------------------------------------------------------------------- /lint/rules/no-extra-non-null-assertion.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows unnecessary non-null assertions. 6 | 7 | Non-null assertions are specified with an `!` saying to the compiler that you 8 | know this value is not null. Specifying this operator more than once in a row, 9 | or in combination with the optional chaining operator (`?`) is confusing and 10 | unnecessary. 11 | 12 | **Invalid:** 13 | 14 | ```typescript 15 | const foo: { str: string } | null = null; 16 | const bar = foo!!.str; 17 | 18 | function myFunc(bar: undefined | string) { 19 | return bar!!; 20 | } 21 | function anotherFunc(bar?: { str: string }) { 22 | return bar!?.str; 23 | } 24 | ``` 25 | 26 | **Valid:** 27 | 28 | ```typescript 29 | const foo: { str: string } | null = null; 30 | const bar = foo!.str; 31 | 32 | function myFunc(bar: undefined | string) { 33 | return bar!; 34 | } 35 | function anotherFunc(bar?: { str: string }) { 36 | return bar?.str; 37 | } 38 | ``` 39 | -------------------------------------------------------------------------------- /lint/rules/no-func-assign.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the overwriting/reassignment of an existing function. 6 | 7 | Javascript allows for the reassignment of a function definition. This is 8 | generally a mistake on the developers part, or poor coding practice as code 9 | readability and maintainability will suffer. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | function foo() {} 15 | foo = bar; 16 | 17 | const a = function baz() { 18 | baz = "now I'm a string"; 19 | }; 20 | 21 | myFunc = existingFunc; 22 | function myFunc() {} 23 | ``` 24 | 25 | **Valid:** 26 | 27 | ```typescript 28 | function foo() {} 29 | const someVar = foo; 30 | 31 | const a = function baz() { 32 | const someStr = "now I'm a string"; 33 | }; 34 | 35 | const anotherFuncRef = existingFunc; 36 | 37 | let myFuncVar = function () {}; 38 | myFuncVar = bar; // variable reassignment, not function re-declaration 39 | ``` 40 | -------------------------------------------------------------------------------- /lint/rules/no-global-assign.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows assignment to native Javascript objects. 6 | 7 | In Javascript, `String` and `Object` for example are native objects. Like any 8 | object, they can be reassigned, but it is almost never wise to do so as this can 9 | lead to unexpected results and difficult to track down bugs. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | Object = null; 15 | undefined = true; 16 | window = {}; 17 | ``` 18 | -------------------------------------------------------------------------------- /lint/rules/no-implicit-declare-namespace-export.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallows the use of implicit exports in ["ambient" namespaces]. 6 | 7 | TypeScript implicitly export all members of an ["ambient" namespaces], except 8 | whether a named export is present. 9 | 10 | ["ambient" namespaces]: https://www.typescriptlang.org/docs/handbook/namespaces.html#ambient-namespaces 11 | 12 | **Invalid:** 13 | 14 | ```ts 15 | // foo.ts or foo.d.ts 16 | declare namespace ns { 17 | interface ImplicitlyExported {} 18 | export type Exported = true; 19 | } 20 | ``` 21 | 22 | **Valid:** 23 | 24 | ```ts 25 | // foo.ts or foo.d.ts 26 | declare namespace ns { 27 | interface NonExported {} 28 | export {}; 29 | } 30 | 31 | declare namespace ns { 32 | interface Exported {} 33 | export { Exported }; 34 | } 35 | 36 | declare namespace ns { 37 | export interface Exported {} 38 | } 39 | ``` 40 | -------------------------------------------------------------------------------- /lint/rules/no-import-assertions.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the `assert` keyword for import attributes. 6 | 7 | ES import attributes (previously called import assertions) has been changed to 8 | use the `with` keyword. The old syntax using `assert` is still supported, but 9 | deprecated. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | import obj from "./obj.json" assert { type: "json" }; 15 | import("./obj2.json", { assert: { type: "json" } }); 16 | ``` 17 | 18 | **Valid:** 19 | 20 | ```typescript 21 | import obj from "./obj.json" with { type: "json" }; 22 | import("./obj2.json", { with: { type: "json" } }); 23 | ``` 24 | -------------------------------------------------------------------------------- /lint/rules/no-import-assign.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows reassignment of imported module bindings. 6 | 7 | ES module import bindings should be treated as read-only since modifying them 8 | during code execution will likely result in runtime errors. It also makes for 9 | poor code readability and difficult maintenance. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | import defaultMod, { namedMod } from "./mod.js"; 15 | import * as modNameSpace from "./mod2.js"; 16 | 17 | defaultMod = 0; 18 | namedMod = true; 19 | modNameSpace.someExportedMember = "hello"; 20 | modNameSpace = {}; 21 | ``` 22 | 23 | **Valid:** 24 | 25 | ```typescript 26 | import defaultMod, { namedMod } from "./mod.js"; 27 | import * as modNameSpace from "./mod2.js"; 28 | 29 | // properties of bound imports may be set 30 | defaultMod.prop = 1; 31 | namedMod.prop = true; 32 | modNameSpace.someExportedMember.prop = "hello"; 33 | ``` 34 | -------------------------------------------------------------------------------- /lint/rules/no-invalid-regexp.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows specifying invalid regular expressions in RegExp constructors. 6 | 7 | Specifying an invalid regular expression literal will result in a SyntaxError at 8 | compile time, however specifying an invalid regular expression string in the 9 | RegExp constructor will only be discovered at runtime. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | const invalidRegExp = new RegExp(")"); 15 | ``` 16 | 17 | **Valid:** 18 | 19 | ```typescript 20 | const goodRegExp = new RegExp("."); 21 | ``` 22 | -------------------------------------------------------------------------------- /lint/rules/no-misused-new.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows defining `constructor`s for interfaces or `new` for classes 6 | 7 | Specifying a `constructor` for an interface or defining a `new` method for a 8 | class is incorrect and should be avoided. 9 | 10 | **Invalid:** 11 | 12 | ```typescript 13 | class C { 14 | new(): C; 15 | } 16 | 17 | interface I { 18 | constructor(): void; 19 | } 20 | ``` 21 | 22 | **Valid:** 23 | 24 | ```typescript 25 | class C { 26 | constructor() {} 27 | } 28 | 29 | interface I { 30 | new (): C; 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /lint/rules/no-new-symbol.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use of `new` operators with built-in `Symbol`s. 6 | 7 | `Symbol`s are created by being called as a function, but we sometimes call it 8 | with the `new` operator by mistake. This rule detects such wrong usage of the 9 | `new` operator. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | const foo = new Symbol("foo"); 15 | ``` 16 | 17 | **Valid:** 18 | 19 | ```typescript 20 | const foo = Symbol("foo"); 21 | 22 | function func(Symbol: typeof SomeClass) { 23 | // This `Symbol` is not built-in one 24 | const bar = new Symbol(); 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /lint/rules/no-node-globals.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use of NodeJS global objects. 6 | 7 | NodeJS exposes a set of global objects that differs from deno (and the web), so 8 | code should not assume they are available. Instead, import the objects from 9 | their defining modules as needed. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | // foo.ts 15 | const buf = Buffer.from("foo", "utf-8"); // Buffer is not a global object in deno 16 | ``` 17 | 18 | **Valid:** 19 | 20 | ```typescript 21 | // foo.ts 22 | import { Buffer } from "node:buffer"; 23 | 24 | const foo = Buffer.from("foo", "utf-8"); 25 | ``` 26 | -------------------------------------------------------------------------------- /lint/rules/no-non-null-asserted-optional-chain.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallow non-null assertions after an optional chain expression. 6 | 7 | `?.` optional chain expressions provide undefined if an object is `null` or 8 | `undefined`. Using a `!` non-null assertion to assert the result of an `?.` 9 | optional chain expression is non-nullable is likely wrong. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | foo?.bar!; 15 | foo?.bar()!; 16 | ``` 17 | 18 | **Valid:** 19 | 20 | ```typescript 21 | foo?.bar; 22 | foo?.bar(); 23 | ``` 24 | -------------------------------------------------------------------------------- /lint/rules/no-non-null-assertion.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallow non-null assertions using the `!` postfix operator. 6 | 7 | TypeScript's `!` non-null assertion operator asserts to the type system that an 8 | expression is non-nullable, as in not `null` or `undefined`. Using assertions to 9 | tell the type system new information is often a sign that code is not fully 10 | type-safe. It's generally better to structure program logic so that TypeScript 11 | understands when values may be nullable. 12 | 13 | **Invalid:** 14 | 15 | ```typescript 16 | interface Example { 17 | property?: string; 18 | } 19 | declare const example: Example; 20 | 21 | const includes = example.property!.includes("foo"); 22 | ``` 23 | 24 | **Valid:** 25 | 26 | ```typescript 27 | interface Example { 28 | property?: string; 29 | } 30 | declare const example: Example; 31 | 32 | const includes = example.property?.includes("foo") ?? false; 33 | ``` 34 | -------------------------------------------------------------------------------- /lint/rules/no-obj-calls.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows calling built-in global objects like functions. 6 | 7 | The following built-in objects should not be invoked like functions, even though 8 | they look like constructors: 9 | 10 | - `Math` 11 | - `JSON` 12 | - `Reflect` 13 | - `Atomics` 14 | 15 | Calling these as functions would result in runtime errors. This rule statically 16 | prevents such wrong usage of them. 17 | 18 | **Invalid:** 19 | 20 | ```typescript 21 | const math = Math(); 22 | const newMath = new Math(); 23 | 24 | const json = JSON(); 25 | const newJSON = new JSON(); 26 | 27 | const reflect = Reflect(); 28 | const newReflect = new Reflect(); 29 | 30 | const atomics = Atomics(); 31 | const newAtomics = new Atomics(); 32 | ``` 33 | 34 | **Valid:** 35 | 36 | ```typescript 37 | const area = (radius: number): number => Math.PI * radius * radius; 38 | 39 | const parsed = JSON.parse("{ foo: 42 }"); 40 | 41 | const x = Reflect.get({ x: 1, y: 2 }, "x"); 42 | 43 | const first = Atomics.load(foo, 0); 44 | ``` 45 | -------------------------------------------------------------------------------- /lint/rules/no-octal.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows expressing octal numbers via numeric literals beginning with `0`. 6 | 7 | Octal numbers can be expressed via numeric literals with leading `0` like `042`, 8 | but this expression often confuses programmers. That's why ECMAScript's strict 9 | mode throws `SyntaxError` for the expression. 10 | 11 | Since ES2015, the other prefix `0o` has been introduced as an alternative. This 12 | new one is always encouraged to use in today's code. 13 | 14 | **Invalid:** 15 | 16 | ```typescript 17 | const a = 042; 18 | const b = 7 + 042; 19 | ``` 20 | 21 | **Valid:** 22 | 23 | ```typescript 24 | const a = 0o42; 25 | const b = 7 + 0o42; 26 | const c = "042"; 27 | ``` 28 | -------------------------------------------------------------------------------- /lint/rules/no-process-global.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use of NodeJS `process` global. 6 | 7 | NodeJS and Deno expose `process` global but they are hard to statically analyze 8 | by tools, so code should not assume they are available. Instead, 9 | `import process from "node:process"`. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | // foo.ts 15 | const foo = process.env.FOO; 16 | ``` 17 | 18 | **Valid:** 19 | 20 | ```typescript 21 | // foo.ts 22 | import process from "node:process"; 23 | 24 | const foo = process.env.FOO; 25 | ``` 26 | -------------------------------------------------------------------------------- /lint/rules/no-prototype-builtins.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use of `Object.prototype` builtins directly. 6 | 7 | If objects are created via `Object.create(null)` they have no prototype 8 | specified. This can lead to runtime errors when you assume objects have 9 | properties from `Object.prototype` and attempt to call the following methods: 10 | 11 | - `hasOwnProperty` 12 | - `isPrototypeOf` 13 | - `propertyIsEnumerable` 14 | 15 | Instead, it's always encouraged to call these methods from `Object.prototype` 16 | explicitly. 17 | 18 | **Invalid:** 19 | 20 | ```typescript 21 | const a = foo.hasOwnProperty("bar"); 22 | const b = foo.isPrototypeOf("bar"); 23 | const c = foo.propertyIsEnumerable("bar"); 24 | ``` 25 | 26 | **Valid:** 27 | 28 | ```typescript 29 | const a = Object.prototype.hasOwnProperty.call(foo, "bar"); 30 | const b = Object.prototype.isPrototypeOf.call(foo, "bar"); 31 | const c = Object.prototype.propertyIsEnumerable.call(foo, "bar"); 32 | ``` 33 | -------------------------------------------------------------------------------- /lint/rules/no-self-assign.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows self assignments. 6 | 7 | Self assignments like `a = a;` have no effect at all. If there are self 8 | assignments in the code, most likely it means that the author is still in the 9 | process of refactoring and there's remaining work they have to do. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | a = a; 15 | [a] = [a]; 16 | [a, b] = [a, b]; 17 | [a, b] = [a, c]; 18 | [a, ...b] = [a, ...b]; 19 | a.b = a.b; 20 | ``` 21 | 22 | **Valid:** 23 | 24 | ```typescript 25 | let a = a; 26 | a += a; 27 | a = [a]; 28 | [a, b] = [b, a]; 29 | a.b = a.c; 30 | ``` 31 | -------------------------------------------------------------------------------- /lint/rules/no-self-compare.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallows comparisons where both sides are exactly the same. 6 | 7 | Comparing a variable or value against itself is usually an error, either a typo 8 | or refactoring error. It is confusing to the reader and may potentially 9 | introduce a runtime error. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | if (x === x) { 15 | } 16 | if ("x" === "x") { 17 | } 18 | if (a.b === a.b) { 19 | } 20 | if (a["b"] === a["b"]) { 21 | } 22 | ``` 23 | 24 | **Valid:** 25 | 26 | ```typescript 27 | if (x === y) { 28 | } 29 | if ("x" === "y") { 30 | } 31 | if (a.b === a.c) { 32 | } 33 | if (a["b"] === a["c"]) { 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /lint/rules/no-sloppy-imports.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Enforces specifying explicit references to paths in module specifiers. 6 | 7 | Non-explicit specifiers are ambiguous and require probing for the correct file 8 | path on every run, which has a performance overhead. 9 | 10 | Note: This lint rule is only active when using `--unstable-sloppy-imports`. 11 | 12 | ### Invalid: 13 | 14 | ```typescript 15 | import { add } from "./math/add"; 16 | import { ConsoleLogger } from "./loggers"; 17 | ``` 18 | 19 | ### Valid: 20 | 21 | ```typescript 22 | import { add } from "./math/add.ts"; 23 | import { ConsoleLogger } from "./loggers/index.ts"; 24 | ``` 25 | -------------------------------------------------------------------------------- /lint/rules/no-slow-types.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [jsr] 3 | --- 4 | 5 | Enforces using types that are explicit or can be simply inferred. 6 | 7 | Read more: https://jsr.io/docs/about-slow-types 8 | -------------------------------------------------------------------------------- /lint/rules/no-sparse-arrays.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallows sparse arrays. 6 | 7 | Sparse arrays are arrays that contain _empty slots_, which later could be 8 | handled either as `undefined` value or skipped by array methods, and this may 9 | lead to unexpected behavior: 10 | 11 | ```typescript 12 | [1, , 2].join(); // => '1,,2' 13 | [1, undefined, 2].join(); // => '1,,2' 14 | 15 | [1, , 2].flatMap((item) => item); // => [1, 2] 16 | [1, undefined, 2].flatMap((item) => item); // => [1, undefined, 2] 17 | ``` 18 | 19 | **Invalid:** 20 | 21 | ```typescript 22 | const items = ["foo", , "bar"]; 23 | ``` 24 | 25 | **Valid:** 26 | 27 | ```typescript 28 | const items = ["foo", "bar"]; 29 | ``` 30 | -------------------------------------------------------------------------------- /lint/rules/no-sync-fn-in-async-fn.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallow sync function inside async function. 6 | 7 | Using sync functions like `Deno.readTextFileSync` blocks the deno event loop so 8 | it's not recommended to use it inside of an async function, because it stops 9 | progress of all other async tasks. 10 | 11 | **Invalid:** 12 | 13 | ```javascript 14 | async function foo() { 15 | Deno.readTextFileSync(""); 16 | } 17 | 18 | const fooFn = async function foo() { 19 | Deno.readTextFileSync(""); 20 | }; 21 | 22 | const fooFn = async () => { 23 | Deno.readTextFileSync(""); 24 | }; 25 | ``` 26 | 27 | **Valid:** 28 | 29 | ```javascript 30 | async function foo() { 31 | await Deno.readTextFile(""); 32 | } 33 | 34 | function foo() { 35 | Deno.readTextFileSync(""); 36 | } 37 | 38 | const fooFn = function foo() { 39 | Deno.readTextFileSync(""); 40 | }; 41 | 42 | const fooFn = () => { 43 | Deno.readTextFileSync(""); 44 | }; 45 | ``` 46 | -------------------------------------------------------------------------------- /lint/rules/no-throw-literal.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallow throwing literals as exceptions. 6 | 7 | It is considered good practice to only `throw` the `Error` object itself or an 8 | object using the `Error` object as base objects for user-defined exceptions. The 9 | fundamental benefit of `Error` objects is that they automatically keep track of 10 | where they were built and originated. 11 | 12 | **Invalid:** 13 | 14 | ```typescript 15 | throw "error"; 16 | throw 0; 17 | throw undefined; 18 | throw null; 19 | ``` 20 | 21 | **Valid:** 22 | 23 | ```typescript 24 | throw new Error("error"); 25 | ``` 26 | -------------------------------------------------------------------------------- /lint/rules/no-top-level-await.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallows the use of top level await expressions. 6 | 7 | Top level await cannot be used when distributing CommonJS/UMD via dnt. 8 | 9 | **Invalid:** 10 | 11 | ```typescript 12 | await foo(); 13 | for await (item of items) {} 14 | ``` 15 | 16 | **Valid:** 17 | 18 | ```typescript 19 | async function foo() { 20 | await task(); 21 | } 22 | async function foo() { 23 | for await (item of items) {} 24 | } 25 | ``` 26 | -------------------------------------------------------------------------------- /lint/rules/no-undef.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallow the use of undeclared variables. 6 | 7 | **Invalid:** 8 | 9 | ```typescript 10 | const foo = someFunction(); 11 | const bar = a + 1; 12 | ``` 13 | -------------------------------------------------------------------------------- /lint/rules/no-unsafe-finally.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use of control flow statements within `finally` blocks. 6 | 7 | Use of the control flow statements (`return`, `throw`, `break` and `continue`) 8 | overrides the usage of any control flow statements that might have been used in 9 | the `try` or `catch` blocks, which is usually not the desired behaviour. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | let foo = function () { 15 | try { 16 | return 1; 17 | } catch (err) { 18 | return 2; 19 | } finally { 20 | return 3; 21 | } 22 | }; 23 | ``` 24 | 25 | ```typescript 26 | let foo = function () { 27 | try { 28 | return 1; 29 | } catch (err) { 30 | return 2; 31 | } finally { 32 | throw new Error(); 33 | } 34 | }; 35 | ``` 36 | 37 | **Valid:** 38 | 39 | ```typescript 40 | let foo = function () { 41 | try { 42 | return 1; 43 | } catch (err) { 44 | return 2; 45 | } finally { 46 | console.log("hola!"); 47 | } 48 | }; 49 | ``` 50 | -------------------------------------------------------------------------------- /lint/rules/no-unsafe-negation.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the usage of negation operator `!` as the left operand of relational 6 | operators. 7 | 8 | `!` operators appearing in the left operand of the following operators will 9 | sometimes cause an unexpected behavior because of the operator precedence: 10 | 11 | - `in` operator 12 | - `instanceof` operator 13 | 14 | For example, when developers write a code like `!key in someObject`, most likely 15 | they want it to behave just like `!(key in someObject)`, but actually it behaves 16 | like `(!key) in someObject`. This lint rule warns such usage of `!` operator so 17 | it will be less confusing. 18 | 19 | **Invalid:** 20 | 21 | 22 | 23 | ```typescript 24 | if (!key in object) {} 25 | if (!foo instanceof Foo) {} 26 | ``` 27 | 28 | **Valid:** 29 | 30 | ```typescript 31 | if (!(key in object)) {} 32 | if (!(foo instanceof Foo)) {} 33 | if ((!key) in object) {} 34 | if ((!foo) instanceof Foo) {} 35 | ``` 36 | -------------------------------------------------------------------------------- /lint/rules/no-unused-labels.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows unused labels. 6 | 7 | A label that is declared but never used is most likely developer's mistake. If 8 | that label is meant to be used, then write a code so that it will be used. 9 | Otherwise, remove the label. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | LABEL1: 15 | while (true) { 16 | console.log(42); 17 | } 18 | 19 | LABEL2: 20 | for (let i = 0; i < 5; i++) { 21 | console.log(42); 22 | } 23 | 24 | LABEL3: 25 | for (const x of xs) { 26 | console.log(x); 27 | } 28 | ``` 29 | 30 | **Valid:** 31 | 32 | ```typescript 33 | LABEL1: 34 | while (true) { 35 | console.log(42); 36 | break LABEL1; 37 | } 38 | 39 | LABEL2: 40 | for (let i = 0; i < 5; i++) { 41 | console.log(42); 42 | continue LABEL2; 43 | } 44 | 45 | for (const x of xs) { 46 | console.log(x); 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /lint/rules/no-useless-rename.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallow useless rename operations where both the original and new name are 6 | exactly the same. This is often a leftover from a refactoring procedure and can 7 | be safely removed. 8 | 9 | **Invalid:** 10 | 11 | ```ts 12 | import { foo as foo } from "foo"; 13 | const { foo: foo } = obj; 14 | export { foo as foo }; 15 | ``` 16 | 17 | **Valid:** 18 | 19 | ```ts 20 | import { foo as bar } from "foo"; 21 | const { foo: bar } = obj; 22 | export { foo as bar }; 23 | ``` 24 | -------------------------------------------------------------------------------- /lint/rules/no-var.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Enforces the use of block scoped variables over more error prone function scoped 6 | variables. Block scoped variables are defined using `const` and `let` keywords. 7 | 8 | `const` and `let` keywords ensure the variables defined using these keywords are 9 | not accessible outside their block scope. On the other hand, variables defined 10 | using `var` keyword are only limited by their function scope. 11 | 12 | **Invalid:** 13 | 14 | ```typescript 15 | var foo = "bar"; 16 | ``` 17 | 18 | **Valid:** 19 | 20 | ```typescript 21 | const foo = 1; 22 | let bar = 2; 23 | ``` 24 | -------------------------------------------------------------------------------- /lint/rules/no-window.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the use of the `window` object. 6 | 7 | The `window` global is no longer available in Deno. Deno does not have a window 8 | and `typeof window === "undefined"` is often used to tell if the code is running 9 | in the browser. 10 | 11 | **Invalid:** 12 | 13 | ```typescript 14 | const a = await window.fetch("https://deno.land"); 15 | 16 | const b = window.Deno.metrics(); 17 | console.log(window); 18 | 19 | window.addEventListener("load", () => { 20 | console.log("Loaded."); 21 | }); 22 | ``` 23 | 24 | **Valid:** 25 | 26 | ```typescript 27 | const a1 = await fetch("https://deno.land"); 28 | const a2 = await globalThis.fetch("https://deno.land"); 29 | const a3 = await self.fetch("https://deno.land"); 30 | 31 | const b1 = Deno.metrics(); 32 | const b2 = globalThis.Deno.metrics(); 33 | const b3 = self.Deno.metrics(); 34 | console.log(globalThis); 35 | 36 | addEventListener("load", () => { 37 | console.log("Loaded."); 38 | }); 39 | ``` 40 | -------------------------------------------------------------------------------- /lint/rules/no-with.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows the usage of `with` statements. 6 | 7 | The `with` statement is discouraged as it may be the source of confusing bugs 8 | and compatibility issues. For more details, see [with - JavaScript | MDN]. 9 | 10 | [with - JavaScript | MDN]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with 11 | 12 | **Invalid:** 13 | 14 | ```typescript 15 | with (someVar) { 16 | console.log("foo"); 17 | } 18 | ``` 19 | -------------------------------------------------------------------------------- /lint/rules/prefer-namespace-keyword.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Recommends the use of `namespace` keyword over `module` keyword when declaring 6 | TypeScript module. 7 | 8 | TypeScript supports the `module` keyword for organizing code, but this wording 9 | can lead to a confusion with the ECMAScript's module. Since TypeScript v1.5, it 10 | has provided us with the alternative keyword `namespace`, encouraging us to 11 | always use `namespace` instead whenever we write TypeScript these days. See 12 | [TypeScript v1.5 release note](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-5.html#namespace-keyword) 13 | for more details. 14 | 15 | **Invalid:** 16 | 17 | ```typescript 18 | module modA {} 19 | 20 | declare module modB {} 21 | ``` 22 | 23 | **Valid:** 24 | 25 | ```typescript 26 | namespace modA {} 27 | 28 | // "ambient modules" are allowed 29 | // https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules 30 | declare module "modB"; 31 | declare module "modC" {} 32 | ``` 33 | -------------------------------------------------------------------------------- /lint/rules/react-no-danger-with-children.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [react, fresh] 3 | --- 4 | 5 | Using JSX children together with `dangerouslySetInnerHTML` is invalid as they 6 | will be ignored. 7 | 8 | **Invalid:** 9 | 10 | ```tsx 11 |
    hello" }}> 12 |

    this will never be rendered

    13 |
    ; 14 | ``` 15 | 16 | **Valid:** 17 | 18 | ```tsx 19 |
    hello" }} />; 20 | ``` 21 | -------------------------------------------------------------------------------- /lint/rules/react-no-danger.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [react, fresh] 3 | --- 4 | 5 | Prevent the use of `dangerouslySetInnerHTML` which can lead to XSS 6 | vulnerabilities if used incorrectly. 7 | 8 | **Invalid:** 9 | 10 | ```tsx 11 | const hello =
    ; 12 | ``` 13 | 14 | **Valid:** 15 | 16 | ```tsx 17 | const hello =
    Hello World!
    ; 18 | ``` 19 | -------------------------------------------------------------------------------- /lint/rules/require-yield.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows generator functions that have no `yield`. 6 | 7 | JavaScript provides generator functions expressed as `function*`, where we can 8 | pause and later resume the function execution at the middle points. At these 9 | points we use the `yield` keyword. In other words, it makes no sense at all to 10 | create generator functions that contain no `yield` keyword, since such functions 11 | could be written as normal functions. 12 | 13 | **Invalid:** 14 | 15 | ```typescript 16 | function* f1() { 17 | return "f1"; 18 | } 19 | ``` 20 | 21 | **Valid:** 22 | 23 | ```typescript 24 | function* f1() { 25 | yield "f1"; 26 | } 27 | 28 | // generator function with empty body is allowed 29 | function* f2() {} 30 | 31 | function f3() { 32 | return "f3"; 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /lint/rules/single-var-declarator.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallows multiple variable definitions in the same declaration statement. 6 | 7 | **Invalid:** 8 | 9 | ```typescript 10 | const foo = 1, bar = "2"; 11 | ``` 12 | 13 | **Valid:** 14 | 15 | ```typescript 16 | const foo = 1; 17 | const bar = "2"; 18 | ``` 19 | -------------------------------------------------------------------------------- /lint/rules/triple-slash-reference.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [] 3 | --- 4 | 5 | Disallow certain triple slash directives in favor of ES6-style import 6 | declarations. 7 | 8 | TypeScript's `///` triple-slash references are a way to indicate that types from 9 | another module are available in a file. Use of triple-slash reference type 10 | directives is generally discouraged in favor of ECMAScript Module imports. This 11 | rule reports on the use of `/// `, 12 | `/// `, or `/// ` directives. 13 | 14 | **Invalid:** 15 | 16 | ```typescript 17 | /// 18 | import * as foo from "foo"; 19 | ``` 20 | 21 | **Valid:** 22 | 23 | ```typescript 24 | import * as foo from "foo"; 25 | ``` 26 | -------------------------------------------------------------------------------- /lint/rules/use-isnan.md: -------------------------------------------------------------------------------- 1 | --- 2 | tags: [recommended] 3 | --- 4 | 5 | Disallows comparisons to `NaN`. 6 | 7 | Because `NaN` is unique in JavaScript by not being equal to anything, including 8 | itself, the results of comparisons to `NaN` are confusing: 9 | 10 | - `NaN === NaN` or `NaN == NaN` evaluate to `false` 11 | - `NaN !== NaN` or `NaN != NaN` evaluate to `true` 12 | 13 | Therefore, this rule makes you use the `isNaN()` or `Number.isNaN()` to judge 14 | the value is `NaN` or not. 15 | 16 | **Invalid:** 17 | 18 | ```typescript 19 | if (foo == NaN) { 20 | // ... 21 | } 22 | 23 | if (foo != NaN) { 24 | // ... 25 | } 26 | 27 | switch (NaN) { 28 | case foo: 29 | // ... 30 | } 31 | 32 | switch (foo) { 33 | case NaN: 34 | // ... 35 | } 36 | ``` 37 | 38 | **Valid:** 39 | 40 | ```typescript 41 | if (isNaN(foo)) { 42 | // ... 43 | } 44 | 45 | if (!isNaN(foo)) { 46 | // ... 47 | } 48 | ``` 49 | -------------------------------------------------------------------------------- /lint_rules.client.ts: -------------------------------------------------------------------------------- 1 | const searchbar = document.getElementById("lint-rule-search"); 2 | 3 | if (searchbar) { 4 | searchbar.addEventListener("input", (e) => { 5 | const query = e.currentTarget?.value; 6 | 7 | const allBoxes = document.querySelectorAll(".lint-rule-box"); 8 | 9 | for (const box of allBoxes) { 10 | if (!box.id.includes(query)) { 11 | box.style.display = "none"; 12 | } else { 13 | box.style.display = "block"; 14 | } 15 | } 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /lume.ts: -------------------------------------------------------------------------------- 1 | import "lume/cli.ts"; 2 | -------------------------------------------------------------------------------- /markdown-it/codeblock-title.ts: -------------------------------------------------------------------------------- 1 | // deno-lint-ignore-file no-explicit-any 2 | 3 | export default function codeblockTitlePlugin(md: any) { 4 | const defaultRender = md.renderer.rules.fence; 5 | 6 | md.renderer.rules.fence = function ( 7 | tokens: any[], 8 | idx: number, 9 | options, 10 | env, 11 | self, 12 | ) { 13 | const render = defaultRender(tokens, idx, options, env, self); 14 | 15 | const maybeTitle = (tokens[idx].info ?? "").match(/title="(.+?)"/)?.[1]; 16 | if (maybeTitle) { 17 | return `
    ${maybeTitle}
    ${render}
    `; 18 | } 19 | 20 | return render; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /markdown-it/replacer.ts: -------------------------------------------------------------------------------- 1 | // deno-lint-ignore-file no-explicit-any 2 | import REPLACEMENTS from "../replacements.json" with { type: "json" }; 3 | 4 | export default function replacerPlugin(md: any) { 5 | md.core.ruler.before("inline", "replacer", (state) => { 6 | state.tokens.forEach((token) => { 7 | Object.entries(REPLACEMENTS).forEach(([key, value]) => { 8 | token.content = token.content.replace( 9 | new RegExp(`\\$${key}`, "g"), 10 | value, 11 | ); 12 | }); 13 | }); 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /middleware/functionRoutes.ts: -------------------------------------------------------------------------------- 1 | import type { RequestHandler } from "lume/core/server.ts"; 2 | import defaultRoutes from "./functions/routes.ts"; 3 | 4 | export default function createRoutingMiddleware( 5 | routeObject: Record = defaultRoutes, 6 | ) { 7 | return function functionRoutesMiddleware( 8 | req: Request, 9 | next: RequestHandler, 10 | ): Promise { 11 | const url = new URL(req.url); 12 | const route = routeObject[url.pathname]; 13 | return route ? route(req) : next(req); 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /middleware/functions/feedback_test.ts: -------------------------------------------------------------------------------- 1 | import { loadSync } from "@std/dotenv"; 2 | loadSync({ export: true }); 3 | 4 | import { assertEquals } from "@std/assert"; 5 | import feedbackRequestHandler from "./feedback.ts"; 6 | 7 | Deno.test("integration: can insert record into feedback google sheet", async () => { 8 | const request = new Request("http://localhost:8000/_api/send-feedback"); 9 | 10 | const result = await feedbackRequestHandler(request); 11 | 12 | assertEquals(result.status, 200); 13 | }); 14 | -------------------------------------------------------------------------------- /middleware/functions/health.ts: -------------------------------------------------------------------------------- 1 | export default async function healthRequestHandler( 2 | _: Request, 3 | ): Promise { 4 | return new Response("OK", { status: 200 }); 5 | } 6 | -------------------------------------------------------------------------------- /middleware/functions/routes.ts: -------------------------------------------------------------------------------- 1 | import type { RequestHandler } from "lume/core/server.ts"; 2 | import healthRequestHandler from "./health.ts"; 3 | import feedbackRequestHandler from "./feedback.ts"; 4 | 5 | export default { 6 | "/_api/health": healthRequestHandler, 7 | "/_api/send-feedback": feedbackRequestHandler, 8 | } satisfies Record; 9 | -------------------------------------------------------------------------------- /middleware/null.ts: -------------------------------------------------------------------------------- 1 | import type { RequestHandler } from "lume/core/server.ts"; 2 | 3 | export default function nullMiddleware( 4 | req: Request, 5 | next: RequestHandler, 6 | ): Promise { 7 | return next(req); 8 | } 9 | -------------------------------------------------------------------------------- /prism.ts: -------------------------------------------------------------------------------- 1 | import Prism from "npm:prismjs@1.29.0"; 2 | import "npm:prismjs@1.29.0/components/prism-typescript.js"; 3 | import "npm:prismjs@1.29.0/components/prism-diff.js"; 4 | import "npm:prismjs@1.29.0/components/prism-json.js"; 5 | import "npm:prismjs@1.29.0/components/prism-bash.js"; 6 | import "npm:prismjs@1.29.0/components/prism-json5.js"; 7 | import "npm:prismjs@1.29.0/components/prism-jsx.js"; 8 | import "npm:prismjs@1.29.0/components/prism-tsx.js"; 9 | 10 | Prism.languages.jsonc = Prism.languages.json5; 11 | 12 | export default Prism; 13 | -------------------------------------------------------------------------------- /reference/_components/Anchor.tsx: -------------------------------------------------------------------------------- 1 | import type { AnchorCtx } from "@deno/doc"; 2 | 3 | export default function ({ anchor }: { anchor: AnchorCtx }) { 4 | return ( 5 | 11 | # 12 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /reference/_components/Arrow.tsx: -------------------------------------------------------------------------------- 1 | export default function () { 2 | return ( 3 | 10 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /reference/_components/Check.tsx: -------------------------------------------------------------------------------- 1 | export default function () { 2 | return ( 3 | 15 | 16 | 17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /reference/_components/Copy.tsx: -------------------------------------------------------------------------------- 1 | export default function () { 2 | return ( 3 | 11 | 12 | 13 | 17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /reference/_components/Deprecated.tsx: -------------------------------------------------------------------------------- 1 | export default function ({ markdownContent }) { 2 | if (markdownContent === null) { 3 | return null; 4 | } 5 | 6 | return ( 7 |
    8 |
    9 | Deprecated 10 |
    11 | 12 | {/*markdown rendering*/} 13 | {markdownContent && ( 14 |
    15 | )} 16 |
    17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /reference/_components/DocBlockSubtitleInterface.tsx: -------------------------------------------------------------------------------- 1 | import type { DocBlockSubtitleInterfaceValueCtx } from "@deno/doc"; 2 | 3 | export default function ( 4 | { subtitle }: { subtitle: DocBlockSubtitleInterfaceValueCtx }, 5 | ) { 6 | return ( 7 |
    8 | extends{" "} 9 | {subtitle.extends.map((item, i) => ( 10 | <> 11 | 12 | {/*typedef rendering*/} 13 | {i > 1 && ,{" "}} 14 | 15 | ))} 16 |
    17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /reference/_components/DocNodeKindIcon.tsx: -------------------------------------------------------------------------------- 1 | import type { DocNodeKindCtx } from "@deno/doc"; 2 | 3 | export default function ({ kinds }: { kinds: DocNodeKindCtx[] }) { 4 | return ( 5 |
    6 | {kinds.map((item, index) => ( 7 |
    12 | {item.char} 13 |
    14 | ))} 15 |
    16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /reference/_components/Example.tsx: -------------------------------------------------------------------------------- 1 | import type { ExampleCtx } from "@deno/doc"; 2 | 3 | export default function ( 4 | { comp, example }: { comp: any; example: ExampleCtx }, 5 | ) { 6 | return ( 7 |
    8 | 9 | 10 | {/*markdown rendering; usually not markdown but just a string, but some cases might be markdown (ie the title contains inline-code)*/} 11 | 12 | {/*markdown rendering*/} 13 |
    14 |
    15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /reference/_components/IndexSignature.tsx: -------------------------------------------------------------------------------- 1 | import type { DocEntryCtx } from "@deno/doc"; 2 | 3 | export default function ( 4 | { comp, indexSignature }: { comp: any; indexSignature: DocEntryCtx }, 5 | ) { 6 | return ( 7 |
    8 | 9 | {indexSignature.readonly && readonly} 10 | {/* param rendering */} 11 | [ 12 | ] 13 | {/* typedef rendering */} 14 | 15 |
    16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /reference/_components/ModuleDoc.tsx: -------------------------------------------------------------------------------- 1 | import type { ModuleDocCtx } from "@deno/doc"; 2 | 3 | export default function ( 4 | { comp, moduleDoc }: { comp: any; moduleDoc: ModuleDocCtx }, 5 | ) { 6 | return ( 7 |
    8 |
    9 | {moduleDoc.deprecated && ( 10 | 11 | )} 12 | 13 |
    14 |
    15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /reference/_components/RefNav.tsx: -------------------------------------------------------------------------------- 1 | export default function (data: Lume.Data, url: string) { 2 | return ( 3 | 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /reference/_components/Section.css: -------------------------------------------------------------------------------- 1 | h1.ref-h1 { 2 | font-size: 1.6rem; 3 | border: 0; 4 | padding: 0; 5 | } 6 | 7 | code.inline-code-block { 8 | display: inline-block; 9 | margin-bottom: 1rem; 10 | padding: 1rem; 11 | } 12 | 13 | hr.hr { 14 | height: 1px; 15 | } 16 | 17 | .anchorable-heading .context-link { 18 | color: hsl(var(--foreground-primary)); 19 | } 20 | -------------------------------------------------------------------------------- /reference/_components/See.tsx: -------------------------------------------------------------------------------- 1 | export default function ({ sees }: { sees: string[] }) { 2 | return ( 3 |
      4 | {/*markdown rendering*/} 5 | {sees.map((see) =>
    • )} 6 |
    7 | ); 8 | } 9 | -------------------------------------------------------------------------------- /reference/_components/SymbolContent.tsx: -------------------------------------------------------------------------------- 1 | import type { SymbolContentCtx } from "@deno/doc"; 2 | 3 | export default function ( 4 | { symbolContent, comp }: { comp: any; symbolContent: SymbolContentCtx }, 5 | ) { 6 | return ( 7 |
    8 | {/*markdown rendering*/} 9 | {symbolContent.docs && ( 10 |
    11 | )} 12 | 13 | {symbolContent.sections.map((section) => ( 14 | 15 | ))} 16 |
    17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /reference/_components/UsageLarge.tsx: -------------------------------------------------------------------------------- 1 | import type { UsagesCtx } from "@deno/doc"; 2 | 3 | export default function ({ usages }: { usages: UsagesCtx | null }) { 4 | if (!usages?.usages?.[0]) { 5 | return null; 6 | } 7 | 8 | return ( 9 |
    10 |

    Usage in Deno

    11 | 12 | {/*markdown rendering*/} 13 |
    14 |
    15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /reference_gen/deno-doc.ts: -------------------------------------------------------------------------------- 1 | import { doc, generateHtmlAsJSON } from "@deno/doc"; 2 | import { 3 | hrefResolver, 4 | renderMarkdown, 5 | stripMarkdown, 6 | } from "./common.ts"; 7 | import categoryDocs from "./deno-categories.json" with { type: "json" }; 8 | 9 | const url = import.meta.resolve("./types/deno.d.ts"); 10 | 11 | console.log("Generating doc nodes..."); 12 | 13 | const nodes = await doc([url], { includeAll: true }); 14 | 15 | console.log("Generating json structure..."); 16 | 17 | const files = await generateHtmlAsJSON(nodes, { 18 | packageName: "Deno", 19 | categoryDocs, 20 | disableSearch: true, 21 | hrefResolver, 22 | usageComposer: { 23 | singleMode: true, 24 | compose(_currentResolve, _usageToMd) { 25 | return new Map(); 26 | }, 27 | }, 28 | markdownRenderer: renderMarkdown, 29 | markdownStripper: stripMarkdown, 30 | }); 31 | 32 | await Deno.writeTextFile("./gen/deno.json", JSON.stringify(files)); 33 | -------------------------------------------------------------------------------- /reference_gen/node-default-map.json: -------------------------------------------------------------------------------- 1 | { 2 | "assert": "assert" 3 | } 4 | -------------------------------------------------------------------------------- /reference_gen/node-exclude-map.json: -------------------------------------------------------------------------------- 1 | { 2 | "assert.d.ts": [ 3 | "assert" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /reference_gen/node-symbol-map.json: -------------------------------------------------------------------------------- 1 | { 2 | "buffer": { 3 | "Blob": "/api/web/~/Blob" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/assert.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/async_hooks.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | AsyncResource: The AsyncResource implementation is a non-functional stub. 4 | executionAsyncId: The executionAsyncId implementation is a non-functional stub. 5 | createHook: The createHook implementation is a non-functional stub. 6 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/buffer.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/child_process.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/cluster.yaml: -------------------------------------------------------------------------------- 1 | status: unsupported 2 | description: All exports are non-functional stubs. 3 | symbols: 4 | "*": This symbol is a non-functional stub. 5 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/console.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/crypto.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | symbols: 3 | Certificate: The methods are non-functional stubs. 4 | generateKeyPair: The `x448` option is not supported. 5 | generatePrime: The `safe`, `add` and `rem` option is not supported. 6 | KeyObject: | 7 | The following are non-functional stubs: 8 | - from 9 | - symmetricKeySize 10 | - equals 11 | - export 12 | publicDecrypt: This symbol is a non-functional stub. 13 | secureHeapUsed: This symbol is a non-functional stub. 14 | setEngine: This symbol is a non-functional stub. 15 | ECDH: The `convertKey` method is a non-functional sub. 16 | Sign: The `sign` and `verify` methods are not supported with non BinaryLike input. 17 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/dgram.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | Socket: | 4 | The following methods are non-functional stubs: 5 | - addMembership 6 | - addSourceSpecificMembership 7 | - dropMembership 8 | - dropSourceSpecificMembership 9 | - setBroadcast 10 | - setMulticastInterface 11 | - setMulticastLoopback 12 | - setMulticastTtl 13 | - setTtl 14 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/diagnostics_channel.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/dns.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | resolve: The `ttl` option is not supported. 4 | resolve4: The `ttl` option is not supported. 5 | resolve6: The `ttl` option is not supported. 6 | resolveCname: The `ttl` option is not supported. 7 | resolveCaa: The `ttl` option is not supported. 8 | resolveMx: The `ttl` option is not supported. 9 | resolveNaptr: The `ttl` option is not supported. 10 | resolveNs: The `ttl` option is not supported. 11 | resolvePtr: The `ttl` option is not supported. 12 | resolveSoa: The `ttl` option is not supported. 13 | resolveSrv: The `ttl` option is not supported. 14 | resolveTxt: The `ttl` option is not supported. 15 | resolveAny: The `ttl` option is not supported. 16 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/domain.yaml: -------------------------------------------------------------------------------- 1 | status: unsupported 2 | description: | 3 | All exports are non-functional stubs. 4 | This is a deprecated Node module. 5 | 6 | symbols: 7 | "*": This symbol is a non-functional stub. 8 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/events.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/fs--promises.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | symbols: 3 | lchmod: The lchmod implementation is a not implemented. 4 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/fs.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | symbols: 3 | writeFile: Missing `utf16le`, `latin1` and `ucs2` encoding. 4 | writeFileSync: Missing `utf16le`, `latin1` and `ucs2` encoding. 5 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/http.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | RequestOptions: Option `createConnection` is not supported. 4 | ClientRequestArgs: Option `createConnection` is not supported. 5 | ClientRequest: Constructor option `createConnection` is not supported. 6 | request: Constructor option `createConnection` is not supported. 7 | get: Constructor option `createConnection` is not supported. 8 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/http2.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | Http2Session: | 4 | The following methods are non-functional stubs: 5 | - setLocalWindowSize 6 | - ping 7 | - localSettings 8 | - remoteSettings 9 | - settings 10 | - ref 11 | - unref 12 | ServerHttp2Session: All methods are non-functional stubs. 13 | Http2Stream: | 14 | The following methods are non-functional stubs: 15 | - aborted 16 | - bufferSize 17 | - endAfterHeaders 18 | - id 19 | - pending 20 | - priority 21 | - rstCode 22 | - sentHeaders 23 | - sentInfoHeaders 24 | - sentTrailers 25 | - state 26 | ClientHttp2Stream: All methods are non-functional stubs. 27 | getDefaultSettings: This function is a non-functional stub. 28 | getPackedSettings: This function is a non-functional stub. 29 | getUnpackedSettings: This function is a non-functional stub. 30 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/https.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | Server: The `cert` and `key` options do not support an array input. 4 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/inspector.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | description: "`console` is supported. Other APIs are non-functional stubs." 3 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/module.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | symbols: 3 | Module: The `register` method is a non-functional stub. 4 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/net.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | Socket: The `fd` option is not supported. 4 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/os.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/path.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/perf_hooks.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | performance: | 4 | The `eventLoopUtilization` method is a non-functional stub. 5 | The `timerify` method is not implemented. 6 | monitorEventLoopDelay: This symbol is not implemented. 7 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/process.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | description: The `multipleResolves` and `worker` events are not supported. 3 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/punycode.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/querystring.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/readline.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/repl.yaml: -------------------------------------------------------------------------------- 1 | status: unsupported 2 | description: All symbols are not supported. 3 | 4 | symbols: 5 | "*": This symbol is not supported. 6 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/sea.yaml: -------------------------------------------------------------------------------- 1 | status: unsupported 2 | description: All symbols are not supported. 3 | 4 | symbols: 5 | "*": This symbol is not supported. 6 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/sqlite.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | description: This module has been added in Deno v2.2. 3 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/stream.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/string_decoder.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/test.yaml: -------------------------------------------------------------------------------- 1 | # TODO: we currently don't render the test module 2 | status: partial 3 | description: Currently only `test` API is supported. 4 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/timers.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/tls.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | createSecurePair: This symbol is currently not supported. 4 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/trace_events.yaml: -------------------------------------------------------------------------------- 1 | status: unsupported 2 | description: All exports are non-functional stubs. 3 | symbols: 4 | "*": This symbol is a non-functional stub. 5 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/tty.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/url.yaml: -------------------------------------------------------------------------------- 1 | status: good 2 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/util.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | transferableAbortSignal: This symbol is currently not supported. 4 | transferableAbortController: This symbol is currently not supported. 5 | MIMEParams: This symbol is currently not supported. 6 | MIMEType: This symbol is currently not supported. 7 | getSystemErrorMap: This symbol is currently not supported. 8 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/v8.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | description: | 3 | `cachedDataVersionTag` and `getHeapStatistics`, `serialize` and `deserialize` are supported. 4 | `setFlagsFromStrings` is a noop. 5 | Other APIs are not supported and will throw and error. 6 | 7 | symbols: 8 | setFlagsFromStrings: This function is a noop. 9 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/vm.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | measureMemory: This is a non-functional stub. 4 | compile: The `importModuleDynamically` parameter is not supported. 5 | createContext: The `importModuleDynamically` parameter is not supported. 6 | Script: | 7 | The `importModuleDynamically` parameter is not supported. 8 | The `runInContext` method does not support break on `SIGINT`. 9 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/wasi.yaml: -------------------------------------------------------------------------------- 1 | status: unsupported 2 | description: All exports are non-functional stubs. 3 | symbols: 4 | "*": This symbol is a non-functional stub. 5 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/worker_threads.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | parentPort: | 4 | The `emit` method is not supported. 5 | The `removeAllListeners` method is not supported. 6 | markAsUntransferable: This symbol is not supported. 7 | moveMessagePortToContext: This symbol is not supported. 8 | receiveMessageOnPort: This symbol is not supported. 9 | Worker: The `getHeapSnapshot` method is not supported. 10 | -------------------------------------------------------------------------------- /reference_gen/node_descriptions/zlib.yaml: -------------------------------------------------------------------------------- 1 | status: partial 2 | symbols: 3 | Options: This class is not supported. 4 | BrotliOptions: This class is not supported. 5 | BrotliCompress: This class is not supported. 6 | BrotliDecompress: This class is not supported. 7 | ZlibBase: This class is not supported. 8 | -------------------------------------------------------------------------------- /reference_gen/web-doc.ts: -------------------------------------------------------------------------------- 1 | import { doc, generateHtmlAsJSON } from "@deno/doc"; 2 | import { 3 | hrefResolver, 4 | renderMarkdown, 5 | stripMarkdown, 6 | } from "./common.ts"; 7 | import categoryDocs from "./web-categories.json" with { type: "json" }; 8 | 9 | const url = import.meta.resolve("./types/web.d.ts"); 10 | 11 | console.log("Generating doc nodes..."); 12 | 13 | const nodes = await doc([url], { includeAll: true }); 14 | 15 | console.log("Generating json structure..."); 16 | 17 | const files = await generateHtmlAsJSON(nodes, { 18 | packageName: "Web", 19 | categoryDocs, 20 | disableSearch: true, 21 | hrefResolver, 22 | usageComposer: { 23 | singleMode: true, 24 | compose(_currentResolve, _usageToMd) { 25 | return new Map(); 26 | }, 27 | }, 28 | markdownRenderer: renderMarkdown, 29 | markdownStripper: stripMarkdown, 30 | }); 31 | 32 | await Deno.writeTextFile("./gen/web.json", JSON.stringify(files)); 33 | -------------------------------------------------------------------------------- /replacements.json: -------------------------------------------------------------------------------- 1 | { 2 | "CLI_VERSION": "2.3.5" 3 | } 4 | -------------------------------------------------------------------------------- /runtime/contributing/images/stickers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/contributing/images/stickers.jpg -------------------------------------------------------------------------------- /runtime/fundamentals/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Fundamentals", 3 | "position": 2, 4 | "link": { 5 | "type": "doc", 6 | "id": "index" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /runtime/fundamentals/images/debugger1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/fundamentals/images/debugger1.png -------------------------------------------------------------------------------- /runtime/fundamentals/images/debugger2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/fundamentals/images/debugger2.jpg -------------------------------------------------------------------------------- /runtime/fundamentals/images/debugger3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/fundamentals/images/debugger3.jpg -------------------------------------------------------------------------------- /runtime/fundamentals/images/debugger4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/fundamentals/images/debugger4.jpg -------------------------------------------------------------------------------- /runtime/fundamentals/images/debugger5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/fundamentals/images/debugger5.jpg -------------------------------------------------------------------------------- /runtime/fundamentals/images/debugger7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/fundamentals/images/debugger7.jpg -------------------------------------------------------------------------------- /runtime/fundamentals/images/jb-ide-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/fundamentals/images/jb-ide-debug.png -------------------------------------------------------------------------------- /runtime/fundamentals/images/node_modules_dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/fundamentals/images/node_modules_dir.png -------------------------------------------------------------------------------- /runtime/fundamentals/images/private-github-new-token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/fundamentals/images/private-github-new-token.png -------------------------------------------------------------------------------- /runtime/fundamentals/images/private-github-token-display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/fundamentals/images/private-github-token-display.png -------------------------------------------------------------------------------- /runtime/fundamentals/images/private-pat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/fundamentals/images/private-pat.png -------------------------------------------------------------------------------- /runtime/getting_started/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Getting Started", 3 | "position": 1, 4 | "link": { 5 | "type": "doc", 6 | "id": "index" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /runtime/getting_started/images/vscode-setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/getting_started/images/vscode-setup.png -------------------------------------------------------------------------------- /runtime/getting_started/images/webstorm_setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/getting_started/images/webstorm_setup.png -------------------------------------------------------------------------------- /runtime/help.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Where to get help" 3 | description: "Guide to getting help with Deno. Find community resources, support channels, discussion forums, and how to engage with the Deno community for troubleshooting and assistance." 4 | oldUrl: /runtime/manual/help/ 5 | --- 6 | 7 | Stuck? Lost? Get Help from the Deno Community. 8 | 9 | ## [Community Discord](https://discord.gg/deno) 10 | 11 | Ask questions and chat with community members in real-time. 12 | 13 | ## [Stack Overflow](https://stackoverflow.com/questions/tagged/deno) 14 | 15 | Stack Overflow is a popular forum to ask code-level questions or if you're stuck 16 | with a specific error. 17 | [Ask your own!](https://stackoverflow.com/questions/ask?tags=deno) 18 | 19 | ## [DEV's Deno Community](https://dev.to/t/deno) 20 | 21 | A great place to find interesting articles about best practices, application 22 | architecture and new learnings. Post your articles with the tag `deno`. 23 | -------------------------------------------------------------------------------- /runtime/reference/cli/add.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "deno add" 3 | command: add 4 | openGraphLayout: "/open_graph/cli-commands.jsx" 5 | openGraphTitle: "deno add" 6 | description: "Add and manage project dependencies with Deno." 7 | --- 8 | -------------------------------------------------------------------------------- /runtime/reference/cli/check.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "deno check" 3 | oldUrl: /runtime/manual/tools/check/ 4 | command: check 5 | openGraphLayout: "/open_graph/cli-commands.jsx" 6 | openGraphTitle: "deno check" 7 | description: "Download and type-check code without execution" 8 | --- 9 | 10 | ## Example 11 | 12 | Type-check without execution. 13 | 14 | ```ts title="example.ts" 15 | const x: string = 1 + 1n; 16 | ``` 17 | 18 | ```bash 19 | deno check example.ts 20 | ``` 21 | -------------------------------------------------------------------------------- /runtime/reference/cli/clean.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "deno clean" 3 | command: clean 4 | openGraphLayout: "/open_graph/cli-commands.jsx" 5 | openGraphTitle: "deno clean" 6 | description: "Remove cached dependencies for a clean start" 7 | --- 8 | -------------------------------------------------------------------------------- /runtime/reference/cli/eval.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "deno eval" 3 | oldUrl: /runtime/manual/tools/eval/ 4 | command: eval 5 | openGraphLayout: "/open_graph/cli-commands.jsx" 6 | openGraphTitle: "deno eval" 7 | description: "Evaluate JavaScript and TypeScript code in the command line" 8 | --- 9 | -------------------------------------------------------------------------------- /runtime/reference/cli/lsp.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "deno lsp" 3 | oldUrl: /runtime/manual/tools/lsp/ 4 | --- 5 | 6 | :::info 7 | 8 | Usually humans do not use this subcommand directly. The 'deno lsp' can provide 9 | IDEs with go-to-definition support and automatic code formatting. 10 | 11 | ::: 12 | 13 | Starts the Deno language server. The language server is used by editors to 14 | provide features like intellisense, code formatting, and more. Read more about 15 | [integrating with the Deno LSP](/runtime/reference/lsp_integration/). 16 | 17 | ## Description 18 | 19 | The 'deno lsp' subcommand provides a way for code editors and IDEs to interact 20 | with Deno using the Language Server Protocol. 21 | 22 | Read more about 23 | [how to connect editors and IDEs to `deno lsp`](https://deno.land/manual@v1.42.4/getting_started/setup_your_environment#editors-and-ides). 24 | -------------------------------------------------------------------------------- /runtime/reference/cli/remove.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "deno remove" 3 | command: remove 4 | openGraphLayout: "/open_graph/cli-commands.jsx" 5 | openGraphTitle: "deno remove" 6 | description: "Remove a dependency from your project" 7 | --- 8 | -------------------------------------------------------------------------------- /runtime/reference/cli/types.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "deno types" 3 | oldUrl: /runtime/manual/tools/types/ 4 | command: types 5 | openGraphLayout: "/open_graph/cli-commands.jsx" 6 | openGraphTitle: "deno types" 7 | description: "Generate TypeScript types from your code" 8 | --- 9 | -------------------------------------------------------------------------------- /runtime/reference/cli/upgrade.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "deno upgrade" 3 | oldUrl: /runtime/manual/tools/upgrade/ 4 | command: upgrade 5 | openGraphLayout: "/open_graph/cli-commands.jsx" 6 | openGraphTitle: "deno upgrade" 7 | description: "Upgrade Deno to the latest, or any specific version" 8 | --- 9 | -------------------------------------------------------------------------------- /runtime/reference/images/command_palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/reference/images/command_palette.png -------------------------------------------------------------------------------- /runtime/reference/images/jupyter-broadcast.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/reference/images/jupyter-broadcast.mp4 -------------------------------------------------------------------------------- /runtime/reference/images/jupyter-cli.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/reference/images/jupyter-cli.gif -------------------------------------------------------------------------------- /runtime/reference/images/jupyter-confirm-prompt.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/reference/images/jupyter-confirm-prompt.mp4 -------------------------------------------------------------------------------- /runtime/reference/images/jupyter-display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/reference/images/jupyter-display.png -------------------------------------------------------------------------------- /runtime/reference/images/jupyter-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/reference/images/jupyter-html.png -------------------------------------------------------------------------------- /runtime/reference/images/jupyter-md.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/reference/images/jupyter-md.png -------------------------------------------------------------------------------- /runtime/reference/images/jupyter-plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/reference/images/jupyter-plot.png -------------------------------------------------------------------------------- /runtime/reference/images/jupyter-svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/reference/images/jupyter-svg.png -------------------------------------------------------------------------------- /runtime/reference/images/jupyter_notebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/reference/images/jupyter_notebook.png -------------------------------------------------------------------------------- /runtime/reference/images/vscode_workspace_initialized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/runtime/reference/images/vscode_workspace_initialized.png -------------------------------------------------------------------------------- /server.ts: -------------------------------------------------------------------------------- 1 | import "@std/dotenv/load"; 2 | 3 | import Server from "lume/core/server.ts"; 4 | import NotFoundMiddleware from "lume/middlewares/not_found.ts"; 5 | import apiDocumentContentTypeMiddleware from "./middleware/apiDocContentType.ts"; 6 | import createGAMiddleware from "./middleware/googleAnalytics.ts"; 7 | import redirectsMiddleware from "./middleware/redirects.ts"; 8 | import createRoutingMiddleware from "./middleware/functionRoutes.ts"; 9 | 10 | export const server = new Server({ root: "." }); 11 | 12 | server.use(redirectsMiddleware); 13 | server.use(NotFoundMiddleware({ root: ".", page404: "./404/" })); 14 | server.use(createRoutingMiddleware()); 15 | server.use(createGAMiddleware(server)); 16 | server.use(apiDocumentContentTypeMiddleware); 17 | 18 | server.start(); 19 | 20 | console.log("Listening on http://localhost:8000"); 21 | -------------------------------------------------------------------------------- /static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/.nojekyll -------------------------------------------------------------------------------- /static/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/android-chrome-192x192.png -------------------------------------------------------------------------------- /static/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/android-chrome-512x512.png -------------------------------------------------------------------------------- /static/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /static/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/apple-touch-icon.png -------------------------------------------------------------------------------- /static/examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/examples.png -------------------------------------------------------------------------------- /static/examples/local.ts: -------------------------------------------------------------------------------- 1 | const local = "This is a local variable inside of local.ts"; 2 | -------------------------------------------------------------------------------- /static/examples/welcome.ts: -------------------------------------------------------------------------------- 1 | console.log("Welcome to Deno!"); 2 | -------------------------------------------------------------------------------- /static/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/favicon-16x16.png -------------------------------------------------------------------------------- /static/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/favicon-32x32.png -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/favicon.ico -------------------------------------------------------------------------------- /static/fonts/courier/CourierPrime-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/fonts/courier/CourierPrime-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/courier/CourierPrime-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/fonts/courier/CourierPrime-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/inter/Inter-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/fonts/inter/Inter-Italic.woff2 -------------------------------------------------------------------------------- /static/fonts/inter/Inter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/fonts/inter/Inter-Regular.woff -------------------------------------------------------------------------------- /static/fonts/inter/Inter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/fonts/inter/Inter-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/inter/Inter-SemiBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/fonts/inter/Inter-SemiBold.woff -------------------------------------------------------------------------------- /static/fonts/inter/Inter-SemiBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/fonts/inter/Inter-SemiBold.woff2 -------------------------------------------------------------------------------- /static/fonts/inter/Inter-SemiBoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/fonts/inter/Inter-SemiBoldItalic.woff2 -------------------------------------------------------------------------------- /static/github-mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/github-mark.png -------------------------------------------------------------------------------- /static/img/checkmark.svg: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /static/img/chevron.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /static/img/cover@xl.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/img/cover@xl.avif -------------------------------------------------------------------------------- /static/img/dark.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /static/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/img/docusaurus.png -------------------------------------------------------------------------------- /static/img/fresh.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/img/jsr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/jsx.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/img/light.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /static/img/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/img/og.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/img/og.webp -------------------------------------------------------------------------------- /static/img/react.svg: -------------------------------------------------------------------------------- 1 | 2 | React Logo 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /static/img/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /static/img/social.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/static/img/social.png -------------------------------------------------------------------------------- /static/js/darkmode.client.js: -------------------------------------------------------------------------------- 1 | const THEME_KEY = "denoDocsTheme"; 2 | const DARK_CLASS = "dark"; 3 | const LIGHT_CLASS = "light"; 4 | 5 | function getPreferredTheme() { 6 | if (THEME_KEY in localStorage) { 7 | return localStorage[THEME_KEY]; 8 | } 9 | return globalThis.matchMedia("(prefers-color-scheme: dark)").matches 10 | ? DARK_CLASS 11 | : LIGHT_CLASS; 12 | } 13 | 14 | function setTheme(theme) { 15 | const root = document.documentElement; 16 | root.classList.add(theme); 17 | root.classList.remove(theme === DARK_CLASS ? LIGHT_CLASS : DARK_CLASS); 18 | } 19 | 20 | setTheme(getPreferredTheme()); 21 | -------------------------------------------------------------------------------- /static/js/nav-toggle.client.js: -------------------------------------------------------------------------------- 1 | const sidebar = document.getElementById("nav"); 2 | 3 | if (sidebar) { 4 | const checkboxes = document.querySelectorAll(".sub-nav-toggle-checkbox"); 5 | checkboxes.forEach((checkbox) => { 6 | // on change of the checkbox, update the checked state in the local storage 7 | checkbox.addEventListener("change", (e) => { 8 | console.log("updated"); 9 | localStorage.setItem(checkbox.id, checkbox.checked); 10 | }); 11 | 12 | // set the checked state of the checkbox based on the value in the local storage 13 | const checked = localStorage.getItem(checkbox.id) === "true"; 14 | checkbox.checked = checked; 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /static/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | 4 | Sitemap: https://docs.deno.com/sitemap.xml 5 | -------------------------------------------------------------------------------- /styleguide/_data.ts: -------------------------------------------------------------------------------- 1 | import { Sidebar } from "../types.ts"; 2 | 3 | export const sidebar = [ 4 | { 5 | title: "Style Guide", 6 | href: "/styleguide/", 7 | items: [ 8 | { 9 | title: "Typography", 10 | href: "/styleguide/typography/", 11 | }, 12 | { 13 | title: "Components", 14 | href: "/styleguide/components/", 15 | }, 16 | { 17 | title: "OG images", 18 | href: "/styleguide/og/", 19 | }, 20 | ], 21 | }, 22 | ] satisfies Sidebar; 23 | 24 | export const sectionTitle = "Style Guide"; 25 | export const sectionHref = "/styleguide/"; 26 | -------------------------------------------------------------------------------- /styleguide/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Style Guide" 3 | description: "A guide to the style and design of the Deno documentation." 4 | --- 5 | 6 | - [Typography](/styleguide/typography) 7 | - [OG images](/styleguide/og) 8 | - [Components](/styleguide/components) 9 | -------------------------------------------------------------------------------- /styleguide/og/cli-commands.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "An example OG image with only a title that is long enough to wrap" 3 | openGraphLayout: "/open_graph/cli-commands.jsx" 4 | openGraphTitle: "deno command" 5 | --- 6 | 7 | There are different variants of the OG image depending on what content is 8 | available on the page. This page is an example of an OG image for the commands 9 | in the CLI reference. 10 | 11 | ## The OG image for this page 12 | 13 | 14 | -------------------------------------------------------------------------------- /styleguide/og/color-override.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Override the color of the OG image" 3 | description: "Showing how a custom color can be used to override the default color of the OG image" 4 | openGraphColor: "#6FD1FF" 5 | --- 6 | 7 | There are different variants of the OG image depending on what content is 8 | available on the page. This page is an example of an OG image that has a local 9 | color variable to override the default color of the OG image. 10 | 11 | ## The OG image for this page 12 | 13 | 14 | -------------------------------------------------------------------------------- /styleguide/og/short-title-and-long-description.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Short title example" 3 | description: "A description of typical length that will wrap under the title and offer some additional information about this page. Perhaps this might sometimes get a little longer." 4 | --- 5 | 6 | There are different variants of the OG image depending on what content is 7 | available on the page. This page is an example of an OG image has a short title 8 | and a longer description. 9 | 10 | ## The OG image for this page 11 | 12 | 13 | -------------------------------------------------------------------------------- /styleguide/og/short-title-and-short-description.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Short title example" 3 | description: "A short description" 4 | --- 5 | 6 | There are different variants of the OG image depending on what content is 7 | available on the page. This page is an example of an OG image has a short title 8 | and a short description. 9 | 10 | ## The OG image for this page 11 | 12 | 13 | -------------------------------------------------------------------------------- /styleguide/og/title-and-description.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "An example OG image with a title that is long enough to wrap to three lines" 3 | description: "A description of typical length that will wrap under the title and offer some additional information about this page" 4 | --- 5 | 6 | There are different variants of the OG image depending on what content is 7 | available on the page. This page is an example of an OG image has both a title 8 | and a description. 9 | 10 | ## The OG image for this page 11 | 12 | 13 | -------------------------------------------------------------------------------- /styleguide/og/title-only.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "An example OG image with only a title that is long enough to wrap" 3 | --- 4 | 5 | There are different variants of the OG image depending on what content is 6 | available on the page. This page is an example of an OG image has only a title. 7 | 8 | ## The OG image for this page 9 | 10 | 11 | -------------------------------------------------------------------------------- /subhosting/api/images/org-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/subhosting/api/images/org-id.png -------------------------------------------------------------------------------- /subhosting/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/docs/b596f0d4ccbd8b3c91bf78cffbe062fa9db26a58/subhosting/index.md -------------------------------------------------------------------------------- /timeUtils.ts: -------------------------------------------------------------------------------- 1 | export function cliNow() { 2 | const timeOnly = new Date().toLocaleTimeString(); 3 | return `[${timeOnly}]`; 4 | } 5 | --------------------------------------------------------------------------------