Socket
Socket
Sign inDemoInstall

filenamify-url

Package Overview
Dependencies
7
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 2.0.0

index.d.ts

13

index.js
'use strict';
var filenamify = require('filenamify');
var humanizeUrl = require('humanize-url');
const filenamify = require('filenamify');
const humanizeUrl = require('humanize-url');
module.exports = function (str, opts) {
if (typeof str !== 'string') {
const filenamifyUrl = (string, options) => {
if (typeof string !== 'string') {
throw new TypeError('Expected a string');
}
return filenamify(humanizeUrl(str), opts);
return filenamify(humanizeUrl(string), options);
};
module.exports = filenamifyUrl;
module.exports.default = filenamifyUrl;
{
"name": "filenamify-url",
"version": "1.0.0",
"description": "Convert a URL to a valid filename",
"license": "MIT",
"repository": "sindresorhus/filenamify-url",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "node test.js"
},
"files": [
"index.js"
],
"keywords": [
"filename",
"file",
"name",
"string",
"str",
"path",
"convert",
"valid",
"dirname",
"url",
"uri",
"address"
],
"dependencies": {
"filenamify": "^1.0.0",
"humanize-url": "^1.0.0"
},
"devDependencies": {
"ava": "0.0.4"
}
"name": "filenamify-url",
"version": "2.0.0",
"description": "Convert a URL to a valid filename",
"license": "MIT",
"repository": "sindresorhus/filenamify-url",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd-check"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"filename",
"file",
"name",
"string",
"path",
"convert",
"valid",
"url",
"uri"
],
"dependencies": {
"filenamify": "^3.0.0",
"humanize-url": "^2.0.0"
},
"devDependencies": {
"ava": "^1.3.1",
"tsd-check": "^0.3.0",
"xo": "^0.24.0"
}
}

@@ -9,3 +9,3 @@ # filenamify-url [![Build Status](https://travis-ci.org/sindresorhus/filenamify-url.svg?branch=master)](https://travis-ci.org/sindresorhus/filenamify-url)

```
$ npm install --save filenamify-url
$ npm install filenamify-url
```

@@ -17,9 +17,9 @@

```js
var filenamifyUrl = require('filenamify-url');
const filenamifyUrl = require('filenamify-url');
filenamifyUrl('http://sindresorhus.com/foo?bar=baz');
//=> sindresorhus.com!foo!bar=baz
//=> 'sindresorhus.com!foo!bar=baz'
filenamifyUrl('http://sindresorhus.com/foo', {replacement: '🐴'});
//=> sindresorhus.com🐴foo
//=> 'sindresorhus.com🐴foo'
```

@@ -30,7 +30,21 @@

See the [`filenamify` API](https://github.com/sindresorhus/filenamify#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](https://github.com/sindresorhus/filenamify#options).
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc