Socket
Socket
Sign inDemoInstall

remark-images

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-images - npm Package Compare versions

Comparing version 0.16.0 to 0.16.1

29

package.json
{
"name": "remark-images",
"version": "0.16.0",
"version": "0.16.1",
"description": "Improved syntax for images in markdown",
"license": "MIT",
"repository": "mdx-js/mdx",
"description": "Improved syntax for images in markdown",
"files": [
"index.js"
],
"keywords": [
"mdx",
"markdown",
"react",
"markdown",
"jsx",
"remark",
"mdxast",
"mdx",
"util",
"image"
],
"homepage": "https://mdxjs.com",
"repository": "mdx-js/mdx",
"bugs": "https://github.com/mdx-js/mdx/issues",
"author": "John Otander <johnotander@gmail.com> (http://johnotander.com)",
"contributors": [
"John Otander <johnotander@gmail.com> (http://johnotander.com)",
"Tim Neutkens <tim@zeit.co>",
"Matija Marohnić <matija.marohnic@gmail.com>",
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"files": [
"index.js"
],
"dependencies": {

@@ -23,3 +32,3 @@ "is-url": "^1.2.2",

},
"gitHead": "2c1c8676327f97b060283c5a9047574d8ada11ec"
"gitHead": "b69654652e22043592da6db45bc8306b05c783ad"
}
# remark-images
Remark plugin to turn image urls into rendered images.
[![Build Status][build-badge]][build]
[![lerna][lerna-badge]][lerna]
[![Join the community on Spectrum][spectrum-badge]][spectrum]
Turn image urls into images with **[remark][]**.
## Installation
```
[npm][]:
```shell
npm i -S remark-images

@@ -13,13 +19,23 @@ ```

Say we have the following file, `example.md`:
```markdown
#### 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:
```javascript
const vfile = require('to-vfile')
const remark = require('remark')
const images = require('remark-images')
const html = require('remark-html')
remark()
.use(images)
.use(html)
.process(markdownString, function (err, file) {
if (err) { throw err }
.process(vfile.readSync('example.md'), function(err, file) {
if (err) throw err
console.log(String(file))

@@ -29,5 +45,5 @@ })

### Example
Now, running `node example` yields:
```md
```markdown
#### A url

@@ -37,18 +53,57 @@

https://c8r-x0.s3.amazonaws.com/lab-components-macbook.jpg
[![](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:
- `http://example.com/image.jpg`
- `/image.jpg`
- `./image.jpg`
- `../image.jpg`
* `https://example.com/image.jpg`
* `/image.jpg`
* `./image.jpg`
* `../image.jpg`
Supported file types:
## Contribute
- `png`
- `svg`
- `jpg`
- `jpeg`
- `gif`
See [`contributing.md` in `mdx-js/mdx`][contributing] for ways to get started.
This organisation has a [Code of Conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.
## License
[MIT][] © [Compositor][] and [ZEIT][]
<!-- Definitions -->
[build]: https://travis-ci.org/mdx-js/mdx
[build-badge]: https://travis-ci.org/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
[lerna-badge]: https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg
[spectrum]: https://spectrum.chat/mdx
[spectrum-badge]: https://withspectrum.github.io/badge/badge.svg
[contributing]: https://github.com/mdx-js/mdx/blob/master/contributing.md
[coc]: https://github.com/mdx-js/mdx/blob/master/code-of-conduct.md
[mit]: license
[remark]: https://github.com/remarkjs/remark
[compositor]: https://compositor.io
[zeit]: https://zeit.co
[npm]: https://docs.npmjs.com/cli/install
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