https://github.com/fabiospampinato/tiny-dirname
A tiny isomorphic ESM alternative to Node's "__dirname" global.
https://github.com/fabiospampinato/tiny-dirname
dirname isomorphic node
Last synced: 4 months ago
JSON representation
A tiny isomorphic ESM alternative to Node's "__dirname" global.
- Host: GitHub
- URL: https://github.com/fabiospampinato/tiny-dirname
- Owner: fabiospampinato
- License: mit
- Created: 2022-04-07T20:59:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-01-17T18:30:12.000Z (over 1 year ago)
- Last Synced: 2025-10-10T20:52:36.766Z (9 months ago)
- Topics: dirname, isomorphic, node
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Tiny Dirname
A tiny isomorphic ESM alternative to Node's "__dirname" global.
## Install
```sh
npm install tiny-dirname
```
## Usage
```ts
import dirname from 'tiny-dirname';
// Let's convert a file URL to a directory path
dirname ( import.meta.url ); // => '/path/to'
```
## License
MIT © Fabio Spampinato