specpress
Version:
Export PDF and/or DOCX files from a subset of Markdown, ASN.1 and JSON files
12 lines (8 loc) • 311 B
JavaScript
import { basename, parse } from "path";
export function getFileNameWithoutExtension(pathFiile) {
// Get the base name of the file path
const baseName = basename(pathFiile);
// Remove the file extension
const fileNameWithoutExtension = parse(baseName).name;
return fileNameWithoutExtension;
}