{"id":13555009,"url":"https://github.com/anu-rock/hello-deno","last_synced_at":"2026-01-21T23:39:46.464Z","repository":{"id":143201275,"uuid":"265538243","full_name":"anu-rock/hello-deno","owner":"anu-rock","description":"A Deno-based \"Hello World\" app","archived":false,"fork":false,"pushed_at":"2020-06-05T03:23:12.000Z","size":11,"stargazers_count":26,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-04T03:32:43.406Z","etag":null,"topics":["ci-cd","covid-19","deno","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anu-rock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-05-20T11:02:57.000Z","updated_at":"2024-01-30T04:38:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ca953c2-10df-4e67-b6ce-2d65ff5ad4c7","html_url":"https://github.com/anu-rock/hello-deno","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anu-rock%2Fhello-deno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anu-rock%2Fhello-deno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anu-rock%2Fhello-deno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anu-rock%2Fhello-deno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anu-rock","download_url":"https://codeload.github.com/anu-rock/hello-deno/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246957223,"owners_count":20860583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci-cd","covid-19","deno","typescript"],"created_at":"2024-08-01T12:02:59.746Z","updated_at":"2026-01-21T23:39:46.406Z","avatar_url":"https://github.com/anu-rock.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Hello, Deno [![Build Status](https://travis-ci.com/anuragbhd/hello-deno.svg?branch=master)](https://travis-ci.com/anuragbhd/hello-deno)\n\n\u003cimg width=\"100\" alt=\"Deno logo animated\" src=\"https://camo.githubusercontent.com/135431e1073ba63356d050b4f449d1cc503f457c/68747470733a2f2f64656e6f6c69622e6769746875622e696f2f616e696d617465642d64656e6f2d6c6f676f2f64656e6f2d636972636c652d32346670732e676966\" /\u003e\n\nA super-simple Deno app that pulls (from an API) national COVID-19 stats for India, and displays the total count of people who have **recovered** from the disease till yesterday\\*.\n\n\u003e \\* the API we use for fetching data provides stats for up to a day prior\n\nWhat else did you expect? Let's spread some positivity in tough times!\n\n---\n\n#### Concepts Covered\n\n- Writing a Deno program (`index.js`)\n- Writing TypeScript (all code + interfaces inside `models/`)\n- Running a Deno program (see [Running](#running))\n- Security and permissions (see [Running](#running))\n- Importing external modules (inside `tests/util_test.js`)\n- Making network calls (inside `index.js`)\n- Debugging a Deno program (see [Debugging](#debugging))\n- Unit testing (see [Testing](#testing))\n- Inspecting dependencies (see [Dependency Inspection](#dependency-inspection))\n- Creating a browser-friendly bundle (see [Bundling](#bundling))\n- Continuous integration \u0026 deployment (see [CI/CD](#cicd))\n\n#### Running\n\n```\ndeno run --allow-net index.ts\n```\n\nProduces an output like (as of 05-Jun-2020):\n\n\u003e 108450 out of 226714 people are healthy again 😄\n\n#### Testing\n\n```\ndeno test\n```\n\nProduces an output like:\n\n\u003e running 2 tests  \n\u003e test getDateString() works correctly with single-digit date ... ok (3ms)  \n\u003e test getDateString() works correctly with double-digit date ... ok (1ms)\n\u003e\n\u003e test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (4ms)\n\n#### Debugging\n\nUsing VS Code's debugger is not very complicated even in the case of Deno apps. It's a tad similar to how we use it with pure, simple Node.js programs. See the file `.vscode/launch.json` to learn more.\n\nTo start debugging, go to VS Code's **Run** sidebar and start the \"Deno Debug\" script. Then on, you should be able to do something like this:\n\n![Debugging a Deno program](https://user-images.githubusercontent.com/1288616/83829482-98959580-a700-11ea-86a2-a1b4e7199d3b.png)\n\n#### Dependency Inspection\n\nSince unlike Node.js Deno does not use a package manager and rather relies on the use of distributed http-hosted external modules, manually keeping a tab on a file's dependency tree may get difficult.\n\nYou can use Deno's built-in tool for the purpose:\n\n```bash\ndeno info \u003cfile or URL\u003e\n```\n\nFor example, our `util_test.ts` file depends on a local module (util.js) and an external module called asserts.ts. The asserts.ts module in turn depends on more modules. How do find that out? Simple:\n\n```bash\n$ deno info tests/util_test.ts\n\n...\ndeps:\nfile:///Users/anurag/Code/Sandbox/hello-deno/tests/util_test.ts\n  ├─┬ https://deno.land/std/testing/asserts.ts\n  │ ├── https://deno.land/std/fmt/colors.ts\n  │ └── https://deno.land/std/testing/diff.ts\n  └── file:///Users/anurag/Code/Sandbox/hello-deno/util.ts\n```\n\n#### Bundling\n\nOne of the key goals behind Deno is to keep its APIs as close to the web standards as possible. So classes, functions and variables outside of Deno namespace are named as per modern web standards. Eg. fetch, TextEncoder, console, crypto, window, and so on.\n\nThis is a powerful thing. It means that we can potentially run the same Deno program on both server and browser.\n\nOur little program `index.ts` is browser-friendly. We can use Deno's built-in bundler to combine all dependencies and generate a single file to use as a script/module inside a static HTML file:\n\n```bash\ndeno bundle index.js \u003e public/bundle.js\n```\n\nAlso see the [CI/CD](#cicd) section below on how we are using this feature for continuous deployment.\n\n#### CI/CD\n\nThis repo uses the wonderful [Travis CI](https://travis-ci.com/) service for continuous integration \u0026 deployment, and the [surge.sh](https://surge.sh/) service as our deployment/web server.\n\nOur CI pipeline is probably the simplest one possible: it just runs unit tests and builds a JS bundle. Our CD pipeline then picks up the bundle and deploys it to Surge.\n\nSince official support for Deno does not yet exist in most (or any!) CI providers, we have to rely on our own hacks. Before running the pipeline, we instruct Travis to install Deno and make it available globally:\n\n```yaml\nbefore_install:\n  - curl -fsSL https://deno.land/x/install/install.sh | sh\n  - sudo mv ~/.deno/bin/deno /usr/local/bin\n\nscript:\n  - deno test\n  - deno bundle index.ts \u003e public/bundle.js\n```\n\nCheck [this page](https://docs.travis-ci.com/user/deployment/surge/) for details on configuring your own Surge deployment.\n\nIf all goes well, your Surge site will look like this:\n\n![Deployed site on Surge.sh](https://user-images.githubusercontent.com/1288616/83832615-b9151e00-a707-11ea-85e5-8c67de38abca.png)\n\n#### Bonus\n\nDeno Package Manager ([dpm](https://github.com/anuragbhd/dpm))\n\n---\n\nCopyleft 2020 • MIT licensed  \nAnurag Bhandari \u003cab@anuragbhandari.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanu-rock%2Fhello-deno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanu-rock%2Fhello-deno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanu-rock%2Fhello-deno/lists"}