You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

gulp-set-timestamp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-set-timestamp

Sets accessed and modified timestamps in files

0.1.0
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-set-timestamp

Sets accessed and modified timestamps in files after the file is written to its destination.

This is inspired by Bernd Matzner's gulp-touch-cmd but allows for passing in the date to be set. If you only need to update the timestamp to the current date/time, you may just want to use gulp-touch-cmd instead or pass in a new date (see examples).

Install

npm i gulp-set-timestamp or npm i --save-dev gulp-set-timestamp for a dev dependency.

Examples

Touch the File / Use Current Date

If dates are not passed, the current date/time will be used for both last accessed and last modified time. This is essentially the functionality that a touch provides.

let gulp = require('gulp'),
    setTimeStamp = require('gulp-set-timestamp');

gulp.task('default', () => {
    gulp.src('./src/**/*')
        .pipe(gulp.dest('./dest'))
        .pipe(setTimeStamp());
});

Use Date for Both Files

Sets a date for both last accessed and last modified.

let gulp = require('gulp'),
    setTimeStamp = require('gulp-set-timestamp');

gulp.task('default', () => {
    gulp.src('./src/**/*')
        .pipe(gulp.dest('./dest'))
        .pipe(setTimeStamp(new Date('2018-07-31T00:00:00'), new Date('2018-01-01T00:00:00')));
});

Misc Notes

I followed the gulp guidelines to create this plugin "the gulp way". If something is amiss, please open an issue, and I'll be happy to follow up.

Tests still need to be added.

Keywords

gulpplugin

FAQs

Package last updated on 31 Jul 2018

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