Package
cross-dirname
[Node.js](https://nodejs.org) + [Gjs](https://gjs.guide/) + [Deno](https://deno.land/) module that returns the current script dirname and filename. Similar to `__dirname` and `__filename` but also works in CommonJs and ES modules.
Key numbers
As of 25 Sept 2026
- Weekly downloads
- 2.8m
- +660% over 12 months
- Gzip bundle size
- -
- No Bundlephobia data
- Dependencies
- 0
- Direct, from package.json
- Last release
- 4 years ago
- v0.1.0
- GitHub stars
- 6
- 1 forks
- Open issues / PRs
- 0 / 2
- Contributors
- -
- Commits, last 52 weeks
- 0
Downloads
Last week 2026-09-15 to 2026-09-21
2,756,166 downloads last week, 12,104,638 in the last month. The 12-month change of +660% compares the average of the last 4 weeks with the first 4 weeks of the series.
- Releases, last 12 months
- 06 in total
- Latest version
- 0.1.0, 22 Jul 20224 years ago
- First published
- 21 Jul 2022
- Last push to GitHub
- 29 Jan 20231,334 days before the snapshot
- Repository archived
- No
- Open issues
- 0
- Open pull requests
- 2
- Commits, last 52 weeks
- 0
- Dependents on npm
- 12
Major versions
- v0 first release 0.0.2, 21 Jul 2022
Recent releases
| Version | Published |
|---|---|
| 0.1.0 | 22 Jul 2022 |
| 0.0.6 | 21 Jul 2022 |
| 0.0.5 | 21 Jul 2022 |
| 0.0.4 | 21 Jul 2022 |
| 0.0.3 | 21 Jul 2022 |
| 0.0.2 | 21 Jul 2022 |
- Module format
- ESM + CommonJSFrom package.json type, main and exports fields
- TypeScript types
- Bundled
- Node.js engine range
- Not declared
- Runtimes
- -
- Unpacked size (npm)
- 10 kB
- Dependencies (0)
- None
npm install cross-dirname- jsDelivr
https://cdn.jsdelivr.net/npm/cross-dirname@0.1.0/ - unpkg
https://unpkg.com/cross-dirname@0.1.0/ - esm.sh
https://esm.sh/cross-dirname@0.1.0
Indexability: Indexed.