truncate-url
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

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'

Package Sidebar

Install

npm i truncate-url

Weekly Downloads

1,817

Version

2.1.0

License

MIT

Unpacked Size

3.42 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus