import { Meta } from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/scripts/Functions/hasNativeDirname - Check __dirname availability'/>

# `hasNativeDirname`

The function checks if the global `__dirname` variable is available in the current environment.

**Returns:**
`boolean` — `true` if `__dirname` is defined, `false` otherwise.

## How it works

The function uses `typeof __dirname !== 'undefined'` to determine if the environment supports native directory name resolution (typically CommonJS environments).

## Example

```typescript
import { hasNativeDirname } from '@dxtmisha/scripts'

if (hasNativeDirname()) {
  console.log('Environment supports native __dirname')
}
```
