get-md-image

1.0.2 • Public • Published

get-md-image

NPM version Build Status Coveralls Status Dependency Status

get image from markdown article

Install

npm install --save get-md-image

Usage

import getImage from 'get-md-image';
 
const input = `
# title
 
description ![meow](http://placekitten.com/g/300)`;
 
getImage(input).alt;  // meow
getImage(input).src;  // http://placekitten.com/g/300
getImage(input).html; // <img src="http://placekitten.com/g/300" alt="meow" />
getImage('');         // undefined ¯\_(ツ)_/¯

API

getImage(input)

input

Required
Type: String

Markdown string.

Related

License

MIT © Vladimir Starkov

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    9
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    9
  • 1.0.1
    0
  • 1.0.0
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i get-md-image

Weekly Downloads

9

Version

1.0.2

License

MIT

Last publish

Collaborators

  • iamstarkov