Skip to content
Convert a URL to a valid filename
Branch: master
Clone or download
Latest commit 7ab4b3b Apr 6, 2019

readme.md

filenamify-url Build Status

Convert a URL to a valid filename

Install

$ npm install filenamify-url

Usage

const filenamifyUrl = require('filenamify-url');

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

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

API

filenamifyUrl(input, [options])

Accepts a URL and returns a valid filename.

input

Type: string

A URL to convert to a valid filename.

options

Type: Object

See the filenamify options.

License

MIT © Sindre Sorhus

You can’t perform that action at this time.