Skip to main content
The Deno 2 Release Candidate is here
Learn more

Get File Extension

GitMoji License: MIT Lines Of Code CodeQL Lint Test

You can get this package by nest.land, deno.land or denopkg.

Usage

This package exposes two Functions, sum and sumSync.

import getFileExtension, { getFileExtensionSync } from "https://deno.land/x/get_file_extension/mod.ts";

console.log(await getFileExtension("test.py")); // "py"

async function somethingAsync() {
  console.log(await getFileExtension("main.rs")); // "rs"
}

somethingAsync();

getFileExtension("README.md").then((ext) => console.log(ext)); // "md"

console.log(getFileExtensionSync("egg.json")); // "json"

License

This project is licensed under the MIT License.