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

3.1.0 • Public • Published

filenamify-url

Convert a URL to a valid filename

Install

npm install filenamify-url

Usage

import filenamifyUrl from 'filenamify-url';

filenamifyUrl('http://sindresorhus.com/foo?bar=baz');
//=> 'sindresorhus.com!foo!bar=baz'

filenamifyUrl('http://sindresorhus.com/foo', {replacement: '🐴'});
//=> 'sindresorhus.com🐴foo'

filenamifyUrl(new URL('http://sindresorhus.com'));
//=> 'sindresorhus.com'

API

filenamifyUrl(url, options?)

Accepts a URL and returns a valid filename.

url

Type: string | URL

A URL to convert to a valid filename.

options

Type: object

See the filenamify options.

Related

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.1.0
    1,409
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.1.0
    1,409
  • 3.0.0
    211
  • 2.1.2
    2,030
  • 2.1.1
    2,027
  • 2.1.0
    686
  • 2.0.0
    0
  • 1.0.0
    80,511

Package Sidebar

Install

npm i filenamify-url

Weekly Downloads

86,874

Version

3.1.0

License

MIT

Unpacked Size

3.92 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus