{"id":15641019,"url":"https://github.com/justjavac/deno-username","last_synced_at":"2026-04-30T10:39:38.019Z","repository":{"id":65976769,"uuid":"226120918","full_name":"justjavac/deno-username","owner":"justjavac","description":"Get the username of the current user","archived":false,"fork":false,"pushed_at":"2020-09-05T16:48:43.000Z","size":14,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-21T12:42:29.643Z","etag":null,"topics":["deno","deno-mod","deno-module","deno-modules"],"latest_commit_sha":null,"homepage":"","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/justjavac.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-12-05T14:29:23.000Z","updated_at":"2020-09-05T16:48:45.000Z","dependencies_parsed_at":"2023-02-19T19:15:44.862Z","dependency_job_id":null,"html_url":"https://github.com/justjavac/deno-username","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/justjavac/deno-username","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno-username","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno-username/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno-username/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno-username/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justjavac","download_url":"https://codeload.github.com/justjavac/deno-username/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno-username/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32462304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["deno","deno-mod","deno-module","deno-modules"],"created_at":"2024-10-03T11:41:00.137Z","updated_at":"2026-04-30T10:39:38.003Z","avatar_url":"https://github.com/justjavac.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno-username\n\n[![tag](https://img.shields.io/github/release/justjavac/deno-username)](https://github.com/justjavac/deno-username/releases)\n[![Build Status](https://github.com/justjavac/deno-username/workflows/ci/badge.svg?branch=master)](https://github.com/justjavac/deno-username/actions)\n[![license](https://img.shields.io/github/license/justjavac/deno-username)](https://github.com/justjavac/deno-username/blob/master/LICENSE)\n[![](https://img.shields.io/badge/deno-v1.0.0-green.svg)](https://github.com/denoland/deno)\n\n\u003e Get the username of the current user\n\nThis module is meant for informational purposes and not for secure identification.\n\n**Requires the `--allow-env` and `--allow-run` flags**.\n\n## Usage\n\n```js\nimport username from \"https://deno.land/x/username/mod.ts\";\n\nawait username();\n// ---\u003e 'justjavac'\n```\n\n## API\n\nIt first tries to get the username from the `SUDO_USER` `LOGNAME` `USER` `LNAME` `USERNAME` environment variables.\nThen falls back to `$ id -un` on macOS / Linux and `$ whoami` on Windows, in the rare case none of the environment variables are set.\n\n### username()\n\nReturns a `Promise\u003cstring | undefined\u003e` with the username.\n\n## Thanks\n\nHeavily inspired by [sindresorhus/usernameh](https://github.com/sindresorhus/username).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustjavac%2Fdeno-username","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustjavac%2Fdeno-username","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustjavac%2Fdeno-username/lists"}