esbuild-plugin-fileloc
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

esbuild-plugin-fileloc

Support __dirname, __filename, __line and additional global variables with esbuild

Install

yarn add -D esbuild-plugin-fileloc

or

npm i -D esbuild-plugin-fileloc

Usage

There are 5 global variables available currently:

console.log(__dirname); // absolute dirname in source
console.log(__filename); // absolute filename in source
console.log(__relativedirname); // relative dirname in source
console.log(__relativefilename); // relative filename in source
console.log(__line); // line number

Typescript declarations

To add type declarations for the global variables to your project you can just add this line to your ts file:

/// <reference types="esbuild-plugin-fileloc" />

Readme

Keywords

none

Package Sidebar

Install

npm i esbuild-plugin-fileloc

Weekly Downloads

1,823

Version

0.0.6

License

MIT

Unpacked Size

7.52 kB

Total Files

9

Last publish

Collaborators

  • martondev