code: function newfile(filepath) {
    let dir = path.dirname(filepath);
    if (path.extname(filepath) === '.shp') dir = path.resolve(dir, '..');
    const name = crypto.randomBytes(8).toString('hex');
    return path.join(dir, name);
  }
docs: A function that hands out a new filepath in the same directory as the given file