Skip to main content

A module to get the the filename or dirname of the current file.

Works with
This package works with Bun
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
JSR Score
100%
Published
a month ago (1.0.1)

A module to get the the filename or dirname of the current file

import { dirname, filename } from "@file-info/esm-file-info"

const __dirname = dirname(import.meta)
const __filename = filename(import.meta)

Add Package

deno add @sicasta/esm-file-info

Import symbol

import * as mod from "@sicasta/esm-file-info";

Add Package

npx jsr add @sicasta/esm-file-info

Import symbol

import * as mod from "@sicasta/esm-file-info";

Add Package

yarn dlx jsr add @sicasta/esm-file-info

Import symbol

import * as mod from "@sicasta/esm-file-info";

Add Package

pnpm dlx jsr add @sicasta/esm-file-info

Import symbol

import * as mod from "@sicasta/esm-file-info";

Add Package

bunx jsr add @sicasta/esm-file-info

Import symbol

import * as mod from "@sicasta/esm-file-info";