get-md-image
v1.0.2
Published
get image from markdown article
Downloads
29
Maintainers
Readme
get-md-image
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
- get-md-content - get content from markdown article
- get-md-date - get date from markdown article
- get-md-desc - get description from markdown article
- get-md-title - get title from markdown article
License
MIT © Vladimir Starkov