code: function replaceFilenameTokens(pattern, next) {
          if (pattern.match(/%[bf]/)) {
            if (typeof source !== 'string') {
              return next(new Error('Cannot replace %f or %b when using an input stream'));
            }
  
            pattern = pattern
              .replace(/%f/g, path.basename(source))
              .replace(/%b/g, path.basename(source, path.extname(source)));
          }
  
          next(null, pattern);
        }
docs: Replace filename tokens (%f, %b) in pattern