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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    18
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    18
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i get-img-src

Weekly Downloads

12

Version

1.0.0

License

MIT

Last publish

Collaborators

  • johno