Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
gulp-transform
Advanced tools
Gulp plugin for performing arbitrary transformations on the contents of files.
Gulp plugin for applying arbitrary transformations to file contents. Useful for incorporating non-gulp functions and modules into your pipeline. Files may be in streaming mode or buffer mode.
Install via npm:
npm install --save-dev gulp-transform
Source file (caesar.txt):
I am constant as the northern star...
Transform task:
const gulp = require('gulp');
const transform = require('gulp-transform');
// Repeat contents three times and prepend filename.
function transformFn(contents, file) {
return [file.basename, contents, contents, contents].join('\n');
}
gulp.task('silly-task', function() {
return gulp.src('/path/to/src/**/*.txt')
.pipe(transform(transformFn)) // Apply transform
.pipe(gulp.dest('/path/to/dest'));
});
Destination file:
caesar.txt
I am constant as the northern star...
I am constant as the northern star...
I am constant as the northern star...
The package exports a single plugin function that takes a callback and an optional options object. The callback is invoked once per file. The contents of the file are passed to the callback and replaced by the return value.
transform(transformFn, [options])
Param | Type | Details |
---|---|---|
transformFn |
Function
|
Function that transforms the contents of each file. Invoked with the
following arguments:
|
options (optional) |
Object
|
Options to modify the behavior of the plugin.
|
Copyright © 2016 Akim McMath. Licensed under the MIT License.
FAQs
A Gulp plugin for applying custom transformations to the contents of files
The npm package gulp-transform receives a total of 3,805 weekly downloads. As such, gulp-transform popularity was classified as popular.
We found that gulp-transform 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.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.