You can get this package by nest.land, deno.land or denopkg.
This package exposes two Functions, getFileExtension and getFileExtensionSync.
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"
This project is licensed under the MIT License.