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 🙏

© 2026 – Pkg Stats / Ryan Hefner

turndown-plugin-image-with-style

v1.0.9

Published

Turndown plugin to add image align and size extensions.

Readme

turndown-plugin-gfm

A Turndown plugin which captures alignment attributes from the style attribute and value from height and width attributes of an img tag adds controlled attributes using the {attr1=val attr2=another} pattern. The purpose is to allow alignment while still enforcing the guard rails of converting to markdown.

Installation

npm:

npm install turndown-plugin-image-with-style

Browser:

<script src="https://unpkg.com/turndown/dist/turndown.js"></script>
<script src="https://unpkg.com/turndown-plugin-image-with-style/dist/turndown-plugin-image-with-style.js"></script>

Usage

// For Node.js
var TurndownService = require('turndown')
var TurndownPluginImageWithStyle = require('turndown-plugin-image-with-style')

var turndownService = new TurndownService()
turndownService.use(TurndownPluginImageWithStyle)
var markdown = turndownService.turndown('<img width="400" style="float:left" src="https://http.cat/405" alt="so awesome"/>')

turndown-plugin-image-with-style looks for the size and alignment declarations applied for image alignment and size.
Specifically, using Quill Image Resize Module with Quill Editor, the editor consistently inserts specific style, height and width attributes that can be matched and handled.

turndown-plugin-image-with-style will convert these to:

  • style="float:left; margin:0px 1em 1em 0px;" OR style="float:right; margin:0px 0px 1em 1em;" OR display:block; margin:auto;"
  • width=[value]
  • height=[value]

It's then up to you to process these attributes when converting back to html.
A handy module is: markdown-it-attrs with markdown-it

example:

var imageWithStyle = require('turndown-plugin-image-with-style')
var turndownService = new TurndownService()
turndownService.use(imageWithStyle)

License

turndown-plugin-image-with-style is released under the MIT license. All original Turndown copyright belongs to Dom Christie, also released under the MIT license.