Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

get-img-src

1.0.0 • Public • Published

get-img-src Build Status js-standard-style

Get image src attributes/urls from HTML.

Installation

npm install --save get-img-src

Usage

var getImgSrc = require('get-img-src')
 
getImgSrc('<img src="some-img.png"></img> <img src="some-other-img.jpg"></img>', function(err, imgSrcs) {
  console.log(imgSrcs)
}) // => ['some-img.png', 'some-other-img.jpg']
 
getImgSrc('<span>HTML without an image</span>', function(err, imgSrcs) {
  console.log(imgSrcs)
}) // => []

License

MIT

Acknowledgements

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with <3 by John Otander (@4lpine).


This package was initially generated with yeoman and the p generator.

install

npm i get-img-src

Downloadsweekly downloads

4

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability