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

gulp-add-missing-post-images

v0.2.1

Published

Creates and adds post images for posts that are missing one.

Downloads

7

Readme

gulp-add-missing-post-images

A gulp plugin for creating an image based on a property in a post's metadata.

Setup and usage

Install gulp-add-missing-postimages using npm:

npm i gulp-add-missing-postimages

In your gulpfile.js:

var gulp = require('gulp'),
    addMissingPostImages = require('gulp-add-missing-post-images');

gulp.task('default', function() {
  return gulp.src('./src/**.*')
    .pipe(addMissingPostImages({
        path: 'data.relativePath',
        title: 'page.title',
        image: 'page.featuredImage.url',
        prefix: 'post-',
        cache: 'cache'
    }))
    .pipe(gulp.dest('./dest'));
});

A common use for this plugin is to create post-based icons (using jdenticon) based on a consistent source such as the relative path in the system or the title.

Options

options.prefix = options.prefix || '';

background

number

Default: 0x00000000

The hex of the background color. By default, this is transparent.

cache

string

Default: undefined

The path to cache the resulting images. If this is undefined, then no cache will be used. If one is there, then if the image exists there, it will be used instead of generating a new one. Likewise, all created images will be placed in the cache.

columns

number

Default: 1

The number of columns to repeat the image.

image

string

Default: data.image

The name of the property (which may have dots) to both determine if the post already has an image (if so, no image will be generated) and to store the resulting relative path of the image once one is created.

padding

number

Default: 0

The number of pixels to place around the tile image (or all the images of multiples are included).

path

string|string[]

Default: path

The name of the property in the file that contains the path of the item. This is used when the path changes relative to other elements. This may go into nested items by using dots (e.g., data.paths.relative). If multiple path objects are given, then each one will be mapped.

prefix

string

Default: ""

The prefix to place before the generated file name.

rows

number

Default: 1

The number of rows of duplicated images should be included.

size

number

Default: 256

The number of pixels for the resulting square image. If multiples icons are included, then this will only be the individual tiles.

spacing

number

Default: 0

The number of pixels between each image of more than one is included.

title

string

Default: data.title

The name of the property (which may have dots) to find the source text to generate the image from.

extensions

string[]

Deafult: ['.html']

A list of extensions to move into their own directories. Files that don't match the given extension will be ignored.