Questions tagged [node-glob]

18 questions
0
votes
1 answer

globbing - Correct way to match some files extensions but not others

I wrote the snippet below as part of grunt-aws-s3 task. var weekCache = 'css|js'; var yearCache = 'jpg|jpeg|png|gif|ico|eot|otf|ttf|woff|woff2'; var prodFiles = [ {expand: true, cwd: 'public', src: ['**/*.!('+weekCache+'|'+yearCache+')'], dest:…
JrBenito
  • 973
  • 8
  • 30
0
votes
1 answer

gulp.src exclude all files matching a pattern except one - not working?

This is what I've got. gulp.src(["app/**/*.js" "!app/environment.*.js","app/environment.prod.js"], {read: false}) I was expecting it to include only environment.prod.js and exclude all other environment.*.js. But it excludes all of them. Only…
lahsrah
  • 9,013
  • 5
  • 37
  • 67
0
votes
0 answers

Returning the result of a Node.js asynchronous call outside of it

var glob = require('glob'); glob('*.jpg', { cwd: 'images/' }, function (err, files) { console.log(files); }); --> I want to console.log(); here. Forgive me that I don't know so basic stuff (probably the question also needs correction). How can I…
Lanti
  • 2,299
  • 2
  • 36
  • 69
1
2