npm

Check out our latest tech talk, "JavaScript Supply Chain Security" presented by VP of Security, Adam Baldwin.Watch it here »

filenamify-url

2.1.0 • Public • Published

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

install

npm i filenamify-url

Downloadsweekly downloads

75,365

version

2.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability