{"id":26086086,"url":"https://github.com/xinchou16/emeta","last_synced_at":"2026-04-17T23:31:31.273Z","repository":{"id":244659820,"uuid":"815911990","full_name":"XinChou16/emeta","owner":"XinChou16","description":"A micro esm meta helper for import.meta data.","archived":false,"fork":false,"pushed_at":"2024-06-16T14:15:10.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T21:36:55.467Z","etag":null,"topics":["cjs","dirname","esm","filename","import","meta","url"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/XinChou16.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-16T14:03:23.000Z","updated_at":"2024-06-16T14:17:34.000Z","dependencies_parsed_at":"2024-06-16T14:25:17.022Z","dependency_job_id":null,"html_url":"https://github.com/XinChou16/emeta","commit_stats":null,"previous_names":["xinchou16/emeta"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XinChou16%2Femeta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XinChou16%2Femeta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XinChou16%2Femeta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XinChou16%2Femeta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XinChou16","download_url":"https://codeload.github.com/XinChou16/emeta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242656030,"owners_count":20164431,"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":["cjs","dirname","esm","filename","import","meta","url"],"created_at":"2025-03-09T06:33:36.649Z","updated_at":"2026-04-17T23:31:26.036Z","avatar_url":"https://github.com/XinChou16.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# emeta\n\nA micro esm meta helper for `import.meta` data.\n\nRequires Node 12.17.0 or Node 14.0.0.\n\nStarting in [Node 20.11.0](https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V20.md#20.11.0) and [Node 21.2.0](https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V21.md#21.2.0) this is now built in: [`import.meta.dirname`](https://nodejs.org/api/esm.html#importmetadirname) / [`import.meta.filename`](https://nodejs.org/api/esm.html#importmetafilename)\n\n## Install\n\n```\nnpm install emeta\n```\n\n## Usage\n\n```js\nimport emeta from 'emeta'\n\nconst meta = emeta(import.meta)\nconsole.log(meta.filename)\n```\n\nor\n\n```js\nimport emeta from 'emeta'\n\nconst { dirname, filename, join, require } = emeta(import.meta)\n\n// OR\nconst meta = emeta(import.meta)\n\n// same as CommonJS __dirname\nconsole.log(meta.dirname)\n\n// same as CommonJS __filename\nconsole.log(meta.filename)\n\n// same as CommonJS path.join(__dirname, 'pages')\nconsole.log(join(import.meta.url, 'pages'))\n\n// same as CommonJS path.join(__dirname, '..', 'pages')\nconsole.log(join(import.meta.url, '..', 'pages'))\n\n// same as CommonJS require\nconsole.log(require('lodash'))\nconsole.log(require.resolve('lodash'))\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxinchou16%2Femeta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxinchou16%2Femeta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxinchou16%2Femeta/lists"}