On Windows, this module calls GetShortPathNameW to convert a path like C:\Program Files
to C:\\PROGRA~1
. On other OSes, it returns the input path.
npm install short-filename
const shortFilename = require('short-filename');
console.log(shortFilename('C:\\Program Files\\Microsoft Office'));
// C:\PROGRA~1\MICROS~2
Copyright © 2023 Particle Industries, Inc. Released under the MIT license