Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
gulp-inheritance
Advanced tools
A gulp plugin for dependency-resolution. There are several options out there, but none of those that I found were a good fit for my gulp setup. Some work like grunt plugins (i.e. they actually work on the file system), others have distinctly different use-cases.
gulp-inheritance
does only a few things, and leaves everything else up to you:
npm install gulp-inheritance --save-dev
Simple example:
gulp.src('src/styles/**/*.scss')
.pipe(gulpInheritance({extract: /@import '(.+)';/g}))
.pipe(process()) // whatever you want to do with the files
.pipe(gulp.dest('dev'))
Complex example:
gulp.src('src/styles/**/*.scss')
.pipe(preProcess())
.pipe(gulpInheritance({
includeAll: true,
extract: /@import '(.+)';/mg
normalizePath: customNormalization,
originalPaths: true
}))
.pipe(sass())
.pipe(postProcess())
.pipe(gulp.dest('dev'))
The two examples above show the plugin's minimum and maximum supported setup. It should be clear, on account of that simplicity, that you can use the plugin for any file format.
The examples apply to SCSS files, but that's just for illustration.
gulp-inheritance
is intentionally devoid of language-specific knowledge
in order to keep it lean. You can, of course,
easily create derivative plugins that contain said knowledge.
This can be either a regular expression (or string) matching the pattern of dependency declaration used, or a function.
m
flag. Also, do not forget the g
flag. The first matching group will be used as dependency path – either relative to the depending file's own path, or absolute.You can give a function for custom path normalization here. E.g. with SCSS imports, you'll want to remove the underscore from partials in order for them to be properly identified.
Applies to both incoming files and their dependencies.
This is useful if you perform any transformations on your files' paths prior to applying this plugin.
ISC
FAQs
Gulp plugin to emit the files that depend on the input files
We found that gulp-inheritance 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.