Get File Extension
Get the extension of a file path.
Ported from Browserify β€
Install
npm install @ultirequiem/file-extension
Usage
ESM only, types included: the same import works in Node.js, Bun and browsers.
import { extname } from "@ultirequiem/file-extension";
extname("main.py"); // .py
extname({ path: "App.js", leadingPeriod: true }); // .js
extname({ path: "mod.ts", leadingPeriod: false }); // ts
Support
Open an Issue, I will check it as soon as possible π
If you want to hurry me up a bit send me a tweet π
Donβt forget to star the repo β
Versioning
We use Semantic Versioning. For the versions available, see the tags π·οΈ
Licence
Licensed under the MIT License π