{"id":18597287,"url":"https://github.com/wiremoons/deno_mod","last_synced_at":"2025-05-16T13:33:44.125Z","repository":{"id":62422277,"uuid":"403079055","full_name":"wiremoons/deno_mod","owner":"wiremoons","description":"A collection of modules written in TypeScript for common Deno programming tasks.","archived":false,"fork":false,"pushed_at":"2022-11-14T20:53:22.000Z","size":102,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-17T23:44:38.167Z","etag":null,"topics":[],"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/wiremoons.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}},"created_at":"2021-09-04T14:35:36.000Z","updated_at":"2023-07-27T09:34:04.000Z","dependencies_parsed_at":"2022-11-01T17:31:56.677Z","dependency_job_id":null,"html_url":"https://github.com/wiremoons/deno_mod","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremoons%2Fdeno_mod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremoons%2Fdeno_mod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremoons%2Fdeno_mod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremoons%2Fdeno_mod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiremoons","download_url":"https://codeload.github.com/wiremoons/deno_mod/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254538543,"owners_count":22087884,"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":[],"created_at":"2024-11-07T01:27:35.794Z","updated_at":"2025-05-16T13:33:44.067Z","avatar_url":"https://github.com/wiremoons.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/hyperium/hyper/master/LICENSE)\n[![deno_mod](https://github.com/wiremoons/deno_mod/actions/workflows/deno_mod-build-deno.yml/badge.svg)](https://github.com/wiremoons/deno_mod/actions/workflows/deno_mod-build-deno.yml)\n[![tag](https://img.shields.io/github/v/release/wiremoons/deno_mod.svg)](https://github.com/wiremoons/deno_mod/releases)\n[![](https://img.shields.io/badge/deno-v1.19.1-green.svg)](https://github.com/denoland/deno)\n\n# deno_mod\n\nA collection of modules written in TypeScript for common Deno programming tasks.\n\n## Modules Overview\n\nThe current modules included, and a brief description of their purpose is below.\nFor more extensive information on each module, see the source code itself, as\nthat includes additional comments. The tests for each module also provide\nexamples of usage. Current modules included are:\n\n- '`exists_dir.ts`' : contains the function `existDir()` that checks if the\n  provided file system path is for a directory which exists. The function returns\n  a `boolean` to confirm if the directory exists.\n- '`exists_file.ts`' : contains the function `existFile()` that checks if the\n  provided file system path for a file exists. The function returns a\n  `boolean` to confirm if the filename provided exists. This can be used as a replacement\n- for the depreciated Deno `exists() ` by using the recommended replacement approach of using \n- `Stat` on the file directly and then check for errors. This function performs that task for you.\n- '`file_mod_time.ts`' : contains the function `getFileModTime()` that returns a\n  string with the date and time the file was last modified, or `undefined` otherwise.\n- `type_guard.ts` : contains a number of type guard functions including:\n  `isNumber()` and `isString()`. These check for specific TypeScript types (ie\n  string, number, etc) and affirm that the type is correct.\n- `to_title_case.ts` : contains function `toTitleCaseFirst()` used to capitalise\n  the first character of a string.\n- `cli_version.ts` : contains function `cliVersion()` used to display basic\n  version information for any command line application.\n\n## Why Create More Deno Modules?\n\nThe use of [Deno Standard Library](https://deno.land/std) or\n[Deno API Runtime](https://doc.deno.land/builtin/stable) is preferable - but I\nwas unable to find specific functions I needed. So I created the following as\n`deno_mod` modules instead. These functions are frequently used in many of my\nprograms. To ensure I only write them once, and maintain them in one place as\nmodules, made sense for many reasons.\n\nYou are welcome to use them as well if you wish.\n\n## Import Usage\n\nBelow describes two approaches to including the `deno_mod` into a project using\n`import`.\n\n### Versions tags\n\nLink to the `mod.ts` file using the module tag for the version that is to be\nused. In the example below the version tag `0.8.1` is specified.\n\nThe recommended approach is to choose a version so you are not impacted by any\nfuture changes unexpectedly. The example below explicitly states the **version\ntag** `0.8.1` which is the current version.\n\n### Import from Deno.Land/X\n\n`deno.land/x` is a hosting service for _Deno_ scripts that can be access and\nsearched from the Deno main web site under\n[Deno Third Party Modules](https://deno.land/x) link. The `deno.land/x` site\ncaches releases of open source modules stored on GitHub and serves them at one\neasy to remember domain. Below are the names to use to access `deno_mod` modules\nfrom the `deno.land/x` site:\n\n```typescript\nhttps://deno.land/x/deno_mod@0.8.1/mod.ts\n```\n\nThe import url for the **current version** is always:\n\n```typescript\nhttps://deno.land/x/deno_mod/mod.ts\n```\n\n### Import from GitHub\n\nAlternatively, if you prefer to import the Deno modules directly from this\nGitHub repo, the following `import` syntax can be used. JUst replace the link\nsyntax shown below with any examples shown for `deno.land/x/deno_mod/`:\n\n```typescript\nhttps://raw.githubusercontent.com/wiremoons/deno_mod/0.8.1/mod.ts\n```\n\nThe `import` url for the **current version** is always:\n\n```typescript\nhttps://raw.githubusercontent.com/wiremoons/deno_mod/main/mod.ts\n```\n\n### Import Specific Modules\n\nImport the specific modules to be used. For example, to only use the modules:\n`existsFile`, `existsDir`, and `isString` the follow import statement would be\nused:\n\n```typescript\nimport {\n  existsDir,\n  existsFile,\n  isString,\n} from \"https://deno.land/x/deno_mod@0.8.1/mod.ts\";\n```\n\nAny of the modules can then be accessed using their name as follows:\n\n```typescript\nif (existsFile(\"/some/file/path.txt\")) {\n  console.log(\"File exists!\");\n} else {\n  console.error(\"File not found.\");\n}\n```\n\n### Import All Modules\n\nAlternatively it is possible to import all the available modules:\n\n```typescript\nimport * as my_deno_mod from \"https://deno.land/x/deno_mod@0.8.1/mod.ts\";\n```\n\nAny module can then be accessed using the name you stated (ie `my_deno_mod` in\nthe example above) as follows:\n\n```typescript\nif (my_deno_mod.existsFile(\"/some/file/path.txt\")) {\n  console.log(\"File exists!\");\n} else {\n  console.error(\"File not found.\");\n}\n```\n\n## Tests\n\nAll modules have associated tests. These can be run with the command:\n`deno test --allow-read`\n\n## License\n\nThe code provided in the modules and their useage is covered by the **MIT\nLicense**. See http://opensource.org/licenses/mit. A copy of the applications\nlicense is here\n[deno_mod MIT License](https://github.com/wiremoons/deno_mod/blob/main/LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiremoons%2Fdeno_mod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiremoons%2Fdeno_mod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiremoons%2Fdeno_mod/lists"}