sindresorhus/humanize-url

Also do truncation

オープン

#1 opened on 2015/09/10

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (7 件のフォーク)user submission
enhancementhelp wanted

Repository metrics

Stars
 (252 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

t'would be nice if this also did truncation -- pass another argument with something like {truncate: 40}, and the url would be nicely truncated, with '…' === '\u2026' replacing the truncated text.

Ex.

humanize('http://example.com/a/cool/page/that-is-really-deeply/nested/', {truncate: 20}') -> 'example.com/…/nested'

humanize('http://example.com/a/cool/page/that-is-really-deeply/nested/', {truncate: 24}') -> 'example.com/a/…/nested'

humanize('http://example.com/a/cool/page/that-is-really-deeply/nested/', {truncate: 30}') -> 'example.com/a/cool/…/nested'

Or this could also be a separate module. module-requests ahoy?

コントリビューターガイド