New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

gulp-file-transform-cache

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-file-transform-cache

Store intermediate gulp transformations in a cache for faster build pipeline.

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
86
-24.56%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-file-transform-cache

Why

Because disk space is cheap. Save the results of expensive file transformation steps in your build pipeline (e.g. babel compilation), so that repeated runs only incur the transformation cost when necessary (e.g. the source file was changed). This module creates an adapter layer wrapping the file-transform-cache module to create a gulp plugin.

Getting Started

Install with npm install gulp-file-transform-cache

Example

Consider the following build pipeline


var gulp         = require('gulp'),
    babel        = require('gulp-babel');

gulp.src(['js/**/*.jsx'])
    .pipe(babel())
    .pipe( gulp.dest('dest') );

Enhance this to create super fast builds that only run the transformation again if it's stale...


var gulp  = require('gulp'),
    babel = require('gulp-babel'),
    gftc  = require('gulp-file-transform-cache');

gulp.src(['js/**/*.jsx'])
    .pipe(gftc({ path: '.babelCache',
                 transformStreams: [ babel() ]
    }))
    .pipe( gulp.dest('dest') );

Options

path

The path to the cache-file which will be read/written to maintain the transform cache

transformStreams

An array of streams to provide any number of successive transformations. For Example [ babel(), minify() ] would be equivalent to babel().pipe(minify()). If only one transform is needed, the array can be omitted. (e.g. transformStreams: babel() )

see the example directory for a more detailed example.

Keywords

gulpplugin

FAQs

Package last updated on 17 Jan 2023

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