Socket
Socket
Sign inDemoInstall

srcset

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

srcset - npm Package Compare versions

Comparing version 0.1.1 to 1.0.0

index.js

19

package.json
{
"name": "srcset",
"version": "0.1.1",
"version": "1.0.0",
"description": "Parse and stringify the HTML <img> srcset attribute",

@@ -12,3 +12,7 @@ "keywords": [

"parse",
"stringify"
"stringify",
"srcset",
"responsive",
"picture",
"element"
],

@@ -18,5 +22,4 @@ "author": {

"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
"url": "sindresorhus.com"
},
"main": "srcset",
"repository": "sindresorhus/srcset",

@@ -26,2 +29,6 @@ "scripts": {

},
"dependencies": {
"array-uniq": "^1.0.2",
"number-is-nan": "^1.0.0"
},
"devDependencies": {

@@ -31,8 +38,8 @@ "mocha": "*"

"engines": {
"node": ">=0.8.0"
"node": ">=0.10.0"
},
"license": "MIT",
"files": [
"srcset.js"
"index.js"
]
}

@@ -10,17 +10,7 @@ # srcset [![Build Status](https://travis-ci.org/sindresorhus/srcset.svg?branch=master)](https://travis-ci.org/sindresorhus/srcset)

Download the library [manually](https://github.com/sindresorhus/srcset/releases) or with a package-manager.
```bash
```
$ npm install --save srcset
```
```bash
$ bower install --save srcset
```
```bash
$ component install sindresorhus/srcset
```
## Usage

@@ -39,2 +29,4 @@

```js
var srcset = require('srcset');
var parsed = srcset.parse('banner-HD.jpg 2x, banner-phone.jpg 100w');

@@ -61,7 +53,7 @@ console.log(parsed);

### srcset.parse()
### .parse()
Accepts a srcset string and returns an array of objects with the possible properties: `url` (always), `width`, `height`, `density`.
### srcset.stringify()
### .stringify()

@@ -73,2 +65,2 @@ Accepts an array of objects with the possible properties: `url` (required), `width`, `height`, `density` and returns a srcset string.

[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](http://sindresorhus.com)
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc