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

inlining-images

v1.0.4

Published

Quick project to enable images to be inlined

Downloads

42

Readme

inlining-images

Quick project to enable images to be inlined

NPM

install size

Setup & Run

The software can be run directly from the source or used as an npm package.

From source

To install from source, checkout this repo, then:

➜  node --version # recommend over 12.xx.xx
➜  npm i # install dependencies

Install the npm package

Install the npm package https://www.npmjs.com/package/inlining-images

npm install inlining-images

Using npx

See below.

Modes of operation

Three modes are available.

Mode 1: process one file and write locally.

In the first it uses the filename of the source file and creates the output file with the same name in the local folder (this can be the same directory as the source, in which case it will overwrite the source file).

➜  node index.js --file=sourcehtml/index.html
➜  open index.html

Mode 2: process one file and write to a specified destination folder

The second mode is where the destination is specified. This is particularly useful in CI's and when running the command with npx which runs in a temporary folder and then deletes that folder immediately afterwards.

➜  node index.js --file=sourcehtml/index.html --destination=`pwd`/packaged.html
➜  open packaged.html

Here's an example of the syntax when running the command using npx (which allows the package to be run without being installed).

npx inlining-images   --file=/full/path/to/source/html/file.html  --destination=/full/path/to/destination/html/file.html

Mode 3: process a folder in-situ recursively

The third mode processes all the .html files in a folder, including subfolders.

➜  node index.js --inlineall=temphtmlfolder/
➜  open temphtmlfolder/index.html #Assuming an index.html exists in that folder.

Here's an example of the syntax when running the command using npx (which allows the package to be run without being installed).

npx inlining-images   --inlineall=/full/path/to/source/html/

Future work

  • ~~inline non-image resources~~
  • compress images before re-inserting them
  • ...

Use case examples

  • To enable images and css to be incorporated into jacoco code coverage reports. Microsoft's Azure DevOps disabled the images and css 3 years ago and only render the basic html which is unattractive and loses information, see https://github.com/MicrosoftDocs/azure-devops-docs/issues/1535

Special thanks to