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

Package Sidebar

Install

npm i get-md-image

Weekly Downloads

2

Version

1.0.2

License

MIT

Last publish

Collaborators

  • iamstarkov