truncateFilename
v0.1.0
Published
truncateFilenames a JavaScript string
Downloads
81
Maintainers
Readme
truncateFilename
Truncates a filename string preserving filename extension.
Install with npm
npm install truncateFilename
To then include truncateFilename in your node app:
var truncateFilename = require("truncateFilename");
Using truncateFilename
var result = truncateFilename("helloWorld.minified.js", 15, "...");
Example
var original = "helloWorld.minified.js";
truncateFilename(original, 15, "...");
// "hello...fied.js"