function browserifyInlineFs(options = {}) {
  /**
   * @param {string} filepath
   * @return {Transform}
   */
  function inlineFsTransform(filepath) {
    /** @type {Array<Buffer>} */
    const chunks = [];

    return new Transform({
      transform(chunk, encoding, callback) {
        chunks.push(Buffer.from(chunk));
        callback();
      },

      flush(callback) {
        const originalCode = Buffer.concat(chunks).toString('utf8');
        inlineFs(originalCode, filepath).then(({code, warnings}) => {
          if (options.verbose && warnings.length) {
            console.log(`warnings for ${path.relative(LH_ROOT, filepath)}`);
            for (const warning of warnings) {
              const {line, column} = warning.location;
              console.log(`  ${warning.text} (${line}:${column})`);
            }
          }

          // Fall back to original if inlineFs did nothing.
          code = code || originalCode;
          callback(null, code);
        });
      },
    });
  }

  return inlineFsTransform;
}
@param {Options} [options]
@return {(filepath: string) => Transform}