node-sanitize-filename icon indicating copy to clipboard operation
node-sanitize-filename copied to clipboard

Add an option to specify an extension

Open mohd-akram opened this issue 5 years ago • 1 comments

Example:

sanitize('long-filename.tar.gz', { extension: '.tar.gz' })

This should truncate the filename while preserving the extension.

mohd-akram avatar Aug 27 '20 10:08 mohd-akram

@mohd-akram Hi, should this issue be closed actually by #63 ? Just found the project recently, seems very useful and compact! I'm using it for sanitizing HTTP "GET" request paths (the resource string). Let me know if there is something, testing or similar, than can be done with this issue. What does truncation mean in the case of filename?

jpaulin avatar Feb 28 '21 15:02 jpaulin