Socket
Socket
Sign inDemoInstall

remark-images

Package Overview
Dependencies
Maintainers
4
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-images

Improved syntax for images in markdown


Version published
Weekly downloads
10K
increased by12.06%
Maintainers
4
Weekly downloads
 
Created
Source

remark-images

Build Status lerna Join the community on Spectrum

Turn image urls into images with remark.

Installation

npm:

npm i -S remark-images

Usage

Say we have the following file, example.md:

#### A url

Below will render an image:

https://c8r-x0.s3.amazonaws.com/lab-components-macbook.jpg

And our script, example.js, looks as follows:

const vfile = require('to-vfile')
const remark = require('remark')
const images = require('remark-images')

remark()
  .use(images)
  .process(vfile.readSync('example.md'), function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

#### A url

Below will render an image:

[![](https://c8r-x0.s3.amazonaws.com/lab-components-macbook.jpg)](https://c8r-x0.s3.amazonaws.com/lab-components-macbook.jpg)

API

remark().use(images)

Transform URLs in text that reference images (png, svg, jpg, jpeg, or gif) to images.

Supported urls / uris:

  • https://example.com/image.jpg
  • /image.jpg
  • ./image.jpg
  • ../image.jpg

Contribute

See contributing.md in mdx-js/mdx for ways to get started.

This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Compositor and ZEIT

Keywords

FAQs

Package last updated on 11 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc