Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-imgdown

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-imgdown

down imgae in src file and save to local

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by150%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-imgdown Build Status

Info

when write blog in markdown, you may use external image in you post, this gulp plugin helps you to download image start with http(s) and save it locally.

Params

  • fpath : this path to save file local, image file name will use format md5(src) + ext
  • upath : this path used to replace the origin image src in html file generated by .md file. the complete path will be upath + name

be careful with these parms, it may affect you html from showing the image correctly.

Usage

var gulp = require('gulp');
var markdown = require('gulp-markdown');
var imgdown = require('gulp-imgdown');
var path = require('path');

var base = __dirname;

gulp.task('markdown', function() {
  return gulp.src('src/article/*.md')
    .pipe(markdown())
    .pipe(imgdown({
      upath: '/images/a/',
      fpath: path.join(base, '/images/a/')
    }))
    .pipe(gulp.dest(function(f) {
      return f.base;
    }));
});

gulp.task('default', function() {
  gulp.watch('src/article/*.md', ['markdown']);
});

Keywords

FAQs

Package last updated on 06 Jun 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc