truncate-url
v2.1.0
Published
Truncate a URL to a specific length
Downloads
16,512
Maintainers
Readme
truncate-url
Truncate a URL to a specific length
Install
$ npm install truncate-url
Usage
import truncateUrl from 'truncate-url';
truncateUrl('https://sindresorhus.com/foo/bar/baz/faz', 30);
//=> 'https://sindresorhus.com/…/faz'