https://github.com/75lb/current-module-paths
https://github.com/75lb/current-module-paths
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/75lb/current-module-paths
- Owner: 75lb
- License: mit
- Created: 2021-04-25T10:01:19.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-12-06T00:14:07.000Z (over 1 year ago)
- Last Synced: 2025-08-21T09:49:21.121Z (11 months ago)
- Language: JavaScript
- Size: 43 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.org/package/current-module-paths)
[](https://www.npmjs.org/package/current-module-paths)
[](https://github.com/75lb/current-module-paths/network/dependents?dependent_type=REPOSITORY)
[](https://github.com/75lb/current-module-paths/network/dependents?dependent_type=PACKAGE)
[](https://github.com/75lb/current-module-paths/actions/workflows/node.js.yml)
[](https://github.com/feross/standard)
# current-module-paths
Access to the CommonJS `__filename` and `__dirname` variables within ECMAScript modules.
```js
import currentModulePaths from 'current-module-paths'
const { __filename, __dirname } = currentModulePaths(import.meta.url)
```
* * *
© 2021-24 Lloyd Brookes \<75pound@gmail.com\>.
Tested by [test-runner](https://github.com/test-runner-js/test-runner).