New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

gulp-fileinfo

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-fileinfo

Reads the names of the files that are coming through the pipe or any other properties that you want.

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

#gulp-fileinfo

Information

Packagegulp-fileinfo
DescriptionReads the names of the vynil files that are coming through the pipe or any other properties that you want (See the Vinyl docs for a full list of properties). You can either show the file list in the console or get an array with the list of files.
Node Version>= 0.10

Usage

var gulp = require('gulp');
var fileinfo = require('gulp-fileinfo');

gulp.task('default', function() {
  return gulp
  	.src('./lib/*.js')
  	.pipe(fileinfo());
});

This will output to the console the list of files coming through the pipe.

If you need to get the list of files in an array, you can pass a callback function as part of the options, that function will receive the list of files in an array as a paramenter

var fileinfo = require('gulp-fileinfo');

gulp.task('default', function() {
  var doSomethingWithTheFilesList = function (filesList){
    //do something with the filesList array here
  }
  
  gulp
    .src('./lib/*.js')
	  .pipe(fileinfo({ callback: doSomethingWithTheFilesList }));
});

The fileList variable will be an array of strings containing the name of the files in the pipe.

Options

By default, the gulp only reads the relative property of the files. If you want something different, you can use:

options.properties

Specifies the name of the property you want to read (instead of reading the relative property) from the files in the pipe, like this:

{"properties": "path"}

If you want to read more than one properties at once, you need to set the properties property as an array of all the properties you want to read.

{"properties": ["relative","path","basename"]}

When the properties value is an array, the filesList array will contain objects (instead of strings), for instance:

[{"relative":"index.js", 
  "path":"path/to/index.js", 
  "basename":"" }]

You can get a full list of the Vinyl files properties here: https://github.com/gulpjs/vinyl

options.callback

Callback function that will be invoked once all the files have been read. It receives as a parameter the filesList array containing all the info read from the files in the pipe.

Keywords

file

FAQs

Package last updated on 02 Sep 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