
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
gulp3-last-run
Advanced tools
An implementation of Gulp 4.x's lastRun
method for Gulp 3.x.
This is a utility, not a plugin. It does not act on files or streams nor does it meet other requirements defined by Gulp to be considered a plugin.
To take advantage of a helpful feature from Gulp 4.x without waiting for it to be released or upgrading from 3.x to 4.x. The original intent is to provide a timestamp value that can be used for filtering.
npm install --save-dev gulp3-last-run
Use Gulp 3 Last Run in combination with gulp-filter-since:
const gulp = require('gulp');
const gulp3LastRun = require('gulp3-last-run');
const gulpLoadPlugins = require('gulp-load-plugins');
const $ = gulpLoadPlugins();
const taskLastRun = gulp3LastRun(gulp);
gulp.task('scripts', function(){
const lastRunMs = taskLastRun.retrieveThenCapture('scripts');
return gulp.src('app/scripts/**/*.js')
.pipe($.filterSince(lastRunMs))
.pipe($.babel())
.pipe(gulp.dest('dist/scripts'))
;
});
gulp.task('watch', ['scripts'], function(){
gulp.watch('app/scripts/**/*.js', ['scripts']);
});
or, use it in combination with vinyl-filter-since and gulp-if:
const gulp = require('gulp');
const gulp3LastRun = require('gulp3-last-run');
const gulpLoadPlugins = require('gulp-load-plugins');
const vinylFilterSince = require('vinyl-filter-since');
const $ = gulpLoadPlugins();
const taskLastRun = gulp3LastRun(gulp);
gulp.task('scripts', function(){
const lastRunMs = taskLastRun.retrieveThenCapture('scripts');
return gulp.src('app/scripts/**/*.js')
.pipe($.if(!!lastRunMs, vinylFilterSince(lastRunMs)))
.pipe($.babel())
.pipe(gulp.dest('dist/scripts'))
;
});
gulp.task('watch', ['scripts'], function(){
gulp.watch('app/scripts/**/*.js', ['scripts']);
});
Returns a plain object containing static methods that act on a reference to a gulp object to get and set last run times. It is basically a wrapper for the last-run module.
Type: Object
A reference to the gulp
module.
retrieveThenCapture
is a convenience method not found in the last-run module. It executes the retrieve
method then the capture
method with a single method call.
Type: String
A string that is used to retrieve the task function from the gulp instance. The task function is then used as the fn
argument for last-run module method arguments.
Type: Object
Options for each method can be provided as option and will be passed to their respective last-run methods if provided.
Type: Number
Assuming
lastRun(fn)
returns 1426000001111,lastRun(fn, 1000)
returns 1426000001000.
Type: Number
If passed the optional timestamp, captures that time instead of
Date.now()
. The captured timestamp can then be retrieved using thelastRun
function.Source: lastRun.capture(fn, [timestamp])
Type: String
A string that is used to retrieve the task function from the gulp instance. The task function is then used as the fn
argument for last-run module method arguments.
Other arguments are passed directly to their last-run module counterparts. gulp3-last-run's retrieve
method is the counter part for last-run's main method.
See last-run's API documentation for more information about each of these methods.
FAQs
An implementation of Gulp 4.x's `lastRun` method for Gulp 3.x.
The npm package gulp3-last-run receives a total of 1 weekly downloads. As such, gulp3-last-run popularity was classified as not popular.
We found that gulp3-last-run demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.