An open API service indexing awesome lists of open source software.

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.

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