unjs / ufo

🔗 URL utils for humans

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Splice filename from URL

beyer-johannes opened this issue · comments

Describe the feature

It whould be a great help if parseURL also strip filenames like http://foo.com/foo/bar.png?test=123#token into { protocol: 'http:', auth: '', host: 'foo.com', pathname: '/foo', search: '?test=123', hash: '#token', filename: 'bar.png' }.

I think its a great feature because files are also a part of url.

Additional information

  • Would you be willing to help implement this feature?

We could expose a new util getFilename(url) to do this 👍🏼

Should be great too