
Security News
n8n Tops 2025 JavaScript Rising Stars as Workflow Platforms Gain Momentum
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.
gulp-track-filenames
Advanced tools
Capture file names before and after transform steps so as to be able to reinstate pre-transform text.
Capture file names before and after transform steps so as to be able to reinstate pre-transform text..
Install with npm.
npm install --save-dev gulp-track-filenames
The following is an overly simplistic example. Typically you would use the replace method in an error reporter or
similar.
var gulp = require('gulp');
var tracking = require('gulp-track-filenames')();
gulp.task('copy', function() {
var session = tracking.create()
return gulp.src('src/js/**/*.js')
.pipe(session.before())
.pipe(gulp.dest('build/js'))
.pipe(session.after());
.on('data', function(file) {
console.log({
after: file.path,
before: tracking.replace(file.path)
});
});
});
It is important to use a different session in each stream as otherwise the order can be confused and before will
not match after. The replace method may be called on the session but is typically called on the top level as
shown.
()Create an instance.
@returns {{create: function, replace: function}}
.create()Create an session that is separated from others.
This is important to ensure that order is preserved when associating before with after.
@returns {{before: function, after: function, replace: function}}
.before()Consider file names from the input stream as those before transformation.
Outputs a stream of the same files.
@returns {stream.Through} A through stream that performs the operation of a gulp stream.
.after()Consider file names from the input stream as those after transformation.
Order must be preserved so as to correctly match the corresponding before files.
Outputs a stream of the same files.
@returns {stream.Through} A through stream that performs the operation of a gulp stream.
.define(before, after)Define an explicit filename transformation.
@param {string} before The filename before transformation
@param {string} after The filename after transformation
@returns The current session on which the method was called
.replace(text)Replace occurrences of after file names with the corresponding before file names for only the current session.
@param {string} text The input text to replace.
@returns {string} The result of the replacement.
.replace(text)Replace occurrences of after file names with the corresponding before file names across all session.
@param {string} text The input text to replace.
@returns {string} The result of the replacement.
FAQs
Capture file names before and after transform steps so as to be able to reinstate pre-transform text.
We found that gulp-track-filenames 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
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.

Security News
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.

Security News
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.