npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fec/remark-responsive-images

v0.1.3-alpha

Published

Remark plugin to generate responsive images.

Downloads

2

Readme

remark-responsive-images

Plugin for Remark to make the images in your Markdown responsives.

Unit tests

Made by 👨‍💻Florian Eckerstorfer in beautiful 🎡 Vienna, Europe.

Table of Contents

  1. Installation
  2. Configuration
  3. Debugging
  4. Contributing
  5. Code of Conduct
  6. License
  7. Changelog

Installation

You need to install @fec/remark-responsive-images with NPM or Yarn. Since this is a plugin for Remark, I assume you already have Remark installed and configured.

npm install @fec/remark-responsive-images
yarn add @fec/remark-responsive-images

Configuration

You can use @fec/remark-responsive-images like any other Remark plugin:

const remark = require('remark');
const images = require('@fec/remark-responsive-images');

const processor = remark().use(images);

@fec/remark-responsive-images gives you some options to customise its behaviour:

const remark = require('remark');
const images = require('@fec/remark-responsive-images');

const processor = remark().use([[images, options]]);

Options

| Option | Default value | Description | | --------------------- | ---------------------- | ---------------------------------------- | | figureClassName | remarkri--figure | Name of CSS class for figure tag | | pictureClassName | remarkri--picture | Name of CSS class for picture tag | | imgClassName | remarkri--img | Name of CSS class for img tag | | figCaptionClassName | remarkri--figcaption | Name of CSS class for figcaption tag | | resolutions | [1, 2, 3] | Resolutions that should be generated | | imageSizes | [320, 640, 960] | Width of the generated images | | srcDir | . | Directory where to look for images | | targetDir | . | Directory where to save generated images | | loadingPolicy | eager | Sets the loading attribute on <img>, lazy to load images when they become visible |

Debugging

@fec/remark-responsive-images uses debug to give you helpful debugging information when something does not work. In debug mode you get information about inspected nodes, skipped images and srcsets and generated images.

DEBUG=RemarkResponsiveImages node examples/remark-html.js

Contributing

To contribute to @fec/remark-responsive-images, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Install dependencies: npm install
  4. Make your changes (and don't forget to update the tests)
  5. Don't forgot to run the tests: npm test
  6. Commit your changes: git commit -m '<commit_message>'
  7. Push to the original branch: git push origin <project_name>/<location>
  8. Create the pull request.

Alternatively see the GitHub documentation on creating a pull request.

Code of Conduct

This project follows the Contributor Covenant Code of Conduct.

License

This project is licensed under the MIT License.

Changelog

Version 0.1.3-alpha (October 10, 2020)

  • #4 Add debug information

Version 0.1.2-alpha (October 9, 2020)

  • #3 Add option to set loading attribute on image

Version 0.1.1-alpha (October 9, 2020)

  • #1 Only process .png, .jpg and .jpeg files
  • #2 Add remark as peer dependency

Version 0.1.0-alpha (October 9, 2020)

  • Initial alpha release