Convert a URL to a valid filename
npm install filenamify-url
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'
Accepts a URL and returns a valid filename.
Type: string | URL
A URL to convert to a valid filename.
Type: object
See the filenamify
options.
- filenamify-cli - CLI for this module
- filenamify - Convert a string to a valid safe filename
- slugify - Slugify a string