truncateFilename

truncateFilenames a JavaScript string


Keywords
truncateFilename, smart truncateFilename, truncateFilename string, truncateFilename filename, string
License
MIT
Install
npm install truncateFilename@0.1.0

Documentation

truncateFilename Build Status npm version devDependency Status

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"

License

MIT License