1.0.2 • Published 9 years ago

get-md-image v1.0.2

Weekly downloads
39
License
MIT
Repository
github
Last release
9 years ago

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