fstream-ignore icon indicating copy to clipboard operation
fstream-ignore copied to clipboard

Accept custom ignore rules in Ignore options

Open indexzero opened this issue 12 years ago • 3 comments

This is currently possible, but the solution only works because ._stat() will be called in the next tick:

  var Ignore = require('fstream-ignore');

  var ignore = Ignore({
    dir: '/path/to/read/files/from',
    ignoreFiles: ['.gitignore']
  });

  ignore.addIgnoreRules(['ignore-this', 'and-this'], 'custom-rules');

  ignore.on('child', function (c) {
    console.dir(c.path);
  });

Would prefer to pass this into the Ignore constructor. Seems more appropriate with how streams work:

  var Ignore = require('fstream-ignore');

  Ignore({
    dir: '/path/to/read/files/from',
    ignoreFiles: ['.gitignore'],
    ignoreRules: ['ignore-this', 'and-this']
  }).on('child', function (c) {
    console.dir(c.path);
  });

Not a huge deal since there is a work-around, but would be nice to have :)

indexzero avatar Jan 05 '13 03:01 indexzero

Agreed. Patch welcome :)

On Friday, January 4, 2013, Charlie Robbins wrote:

This is currently possible, but the solution only works because ._stat()will be called in the next tick:

var Ignore = require('fstream-ignore');

var ignore = Ignore({ dir: '/path/to/read/files/from', ignoreFiles: ['.gitignore'] });

ignore.addIgnoreRules(['ignore-this', 'and-this'], 'custom-rules');

ignore.on('child', function (c) { console.dir(c.path); });

Would prefer to pass this into the Ignore constructor. Seems more appropriate with how streams work:

var Ignore = require('fstream-ignore');

Ignore({ dir: '/path/to/read/files/from', ignoreFiles: ['.gitignore'], ignoreRules: ['ignore-this', 'and-this'] }).on('child', function (c) { console.dir(c.path); });

Not a huge deal since there is a work-around, but would be nice to have :)

— Reply to this email directly or view it on GitHubhttps://github.com/isaacs/fstream-ignore/issues/4.

isaacs avatar Jan 05 '13 21:01 isaacs

vote +1

@isaacs could you please take a look to patch?

veged avatar May 07 '13 13:05 veged

vote +1

reekoheek avatar Mar 27 '15 07:03 reekoheek