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

manipulate-my-image

v0.0.3

Published

MMI is a directive that allows consumers to zoom and manipulate images and other elements.

Readme

Manipulate My Image (MMI)

Manipulate My Image (MMI) is an easy-to-use image-manipulation directive that can be easily pulled into any new or existing Angular 2 solution. To use this library, place the "manipulate-img" directive name into your target element, like <img src="myimage.png" height="500px" width="500px" manipulate-img />

The guiding vision for this library is to have an unopinionated tool that makes as few assumptions of the surrounding context as possible. This library is currently in alpha as features are still underway, and testing has been minimal thus far. I'll try to triage and fix issues as quickly as possible, when they are reported. Technically, this library may also work on non-image elements (text fields, divs, etc.), but testing does not currently cover non-image elements.

Current Features:

  1. Zoom-In - Enlarges the Image, focused on where the user clicked within the element
  2. Zoom-Out - Shrinks the Image, retaining centered-focus on where the user clicked with the element. The element cannot be shrunk below its parent-container' dimensions.
  3. Reset Image - Resets the image element to match the dimensions of its parent container

Future Features:

  1. Configuration of keybindings and other directive settings
  2. Contrast
  3. Brightness
  4. Shifting Images via keyboard
  5. Test Sets

Assumptions:

The MMI directive does make a few assumptions about its context, that cannot be avoided without making the library more opinionated than it should be.

The largest assumption is that the image element will always take 100% of its parent-containers dimensions. This means that if you do not want the image element to take 100% of an area, you will have to place the image-to-manipulate in a container, and size the container to match your use-case.

For example:

```
<img src="myimage.png" height="500px" width="500px" manipulate-img />
```

will take up 100% of the parent container, regardless of the height and width styles.

To make this img have a 500px height and width, you'd need to change this to:

```
<div class="parent" width="500px" height="500px">
	<img src="myimage.png" manipulate-img />
</div>
```

Same rule applies for percents and other metrics.

The second assumption, is that the keybindings are currently hardcoded:

  1. Pressing the spacebar while the element is focused or left-clicking the element will zoom in
  2. Pressing Ctrl + spacebar while the element is focused or right-clicking the element will zoom out
  3. resetImg() is the exposed interface for resetting the image size

If a keypress is used to zoom in or zoom out, the center of parent element is used as the default coordinate points to zoom in/out