filenamify-url
Convert a URL to a valid filename
Last updated 6 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install filenamify-url 
SYNC missed versions from official npm registry.

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(url, options?)

Accepts a URL and returns a valid filename.

url

Type: string

A URL to convert to a valid filename.

options

Type: object

See the filenamify options.

Current Tags

  • 2.1.1                                ...           latest (8 months ago)

4 Versions

  • 2.1.1                                ...           8 months ago
  • 2.1.0                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.0.0                                ...           6 years ago

Copyright 2014 - 2016 © taobao.org |