# mjs-dirname

> Less verbose way to get a files `__dirname` and `__filename` in mjs files. Alternatively, one could use thrown exceptions in the helper methods to avoid providing import.meta.url as an argument, but I would prefer to avoid that. The result is as follows:

Latest version **1.0.0** (published 2020-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install mjs-dirname
pnpm add mjs-dirname
yarn add mjs-dirname
bun add mjs-dirname
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-11-19 |
| First published | 2020-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | stefanpenner |

## Links

- npm: https://www.npmjs.com/package/mjs-dirname
- npm.io page: https://npm.io/package/mjs-dirname

## Recent versions

- 1.0.0 (latest) — 2020-11-19

## README

# mjs-dirname ![CI](https://github.com/stefanpenner/mjs-dirname/workflows/CI/badge.svg)

Less verbose way to get a files `__dirname` and `__filename` in mjs files. Alternatively, one could use thrown exceptions in the helper methods to avoid providing import.meta.url as an argument, but I would prefer to avoid that. The result is as follows:

## Usage

```sh
yarn add mjs-dirname
```

```js
import { dirname, filename } from 'mjs-dirname';

const __dirname = dirname(import.meta.url);
const __filename = filename(import.meta.url);
```

---
_Source: https://npm.io/package/mjs-dirname · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
