{"id":21437395,"url":"https://github.com/keidrun/dirfilename","last_synced_at":"2025-03-16T23:25:12.425Z","repository":{"id":51489010,"uuid":"478526576","full_name":"keidrun/dirfilename","owner":"keidrun","description":"Alternatives to __dirname and __filename when using ES modules.","archived":false,"fork":false,"pushed_at":"2022-08-03T07:36:17.000Z","size":221,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T09:04:24.289Z","etag":null,"topics":["dirname","esm","filename","import","meta"],"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/keidrun.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":"2022-04-06T11:18:48.000Z","updated_at":"2022-06-06T14:34:55.000Z","dependencies_parsed_at":"2022-08-21T10:40:22.016Z","dependency_job_id":null,"html_url":"https://github.com/keidrun/dirfilename","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keidrun%2Fdirfilename","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keidrun%2Fdirfilename/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keidrun%2Fdirfilename/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keidrun%2Fdirfilename/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keidrun","download_url":"https://codeload.github.com/keidrun/dirfilename/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243946247,"owners_count":20373014,"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":["dirname","esm","filename","import","meta"],"created_at":"2024-11-23T00:19:31.525Z","updated_at":"2025-03-16T23:25:12.405Z","avatar_url":"https://github.com/keidrun.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dirfilename\n\n[![NPM version](https://badge.fury.io/js/dirfilename.svg)](https://npmjs.org/package/dirfilename) [![CI](https://github.com/keidrun/dirfilename/actions/workflows/publish.yml/badge.svg)](https://github.com/keidrun/dirfilename/actions/workflows/publish.yml) [![codecov](https://codecov.io/gh/keidrun/dirfilename/branch/main/graph/badge.svg?token=i5tN0QQ197)](https://codecov.io/gh/keidrun/dirfilename) [![Known Vulnerabilities](https://snyk.io/test/github/keidrun/dirfilename/badge.svg)](https://snyk.io/test/github/keidrun/dirfilename) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nAlternatives to `__dirname` and `__filename` when using ES modules.\n\n## Install\n\n```shell\nnpm i dirfilename\n```\n\n## Usage\n\n```typescript\nimport { dirname, filename } from 'dirfilename'\n\nconst __dirname = dirname(import.meta.url)\nconst __filename = filename(import.meta.url)\n```\n\nOr\n\n```typescript\nimport { dirname, filename } from 'dirfilename/async'\n\nconst __dirname = await dirname(import.meta.url)\nconst __filename = await filename(import.meta.url)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeidrun%2Fdirfilename","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeidrun%2Fdirfilename","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeidrun%2Fdirfilename/lists"}