Socket
Book a DemoInstallSign in
Socket

gulp-ogimage

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-ogimage

Generate OG Images automatically using Gulp and node-canvas

latest
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

gulp-ogimage

Generates Og Images automatically using Gulp

Usage

var gulp_og_image = require("gulp-ogimage");

var ogImage = function() {
  return gulp.src("./build/templates/*.html")
  .pipe(
    gulp_og_image({
      base : function() {
        return "https://example.com/images/og";
      },

      directory : function() {
        return "./build/images/og"
      },

      backgroundImage : function() {
      	// Optional: Add a background image
        return "./srcs/images/common/og/background.png"
      },

      title : function(file, $) {
      	// Cheerio query selector
        return $("h1").first().text();
      },

      description : function(file, $) {
      	// Cheerio query selector
        return $("p").first().text();
      }
    })
  ).pipe(
    gulp.dest(
      "./templates"
    )
  );
};

gulp.start(ogImage)

FAQs

Package last updated on 16 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts