docs: function pkgfinder(module) {
    const initial = initialDirectory(module);
    let current = initial;
    let pathname;
    let pkg;
    while (true) {
      pathname = path.resolve(current, 'package.json');
      try {
        pkg = require(pathname);
        break;
      } catch (err) {
        if (err.code !== 'MODULE_NOT_FOUND') {
          throw err;
        }
      }
      let parent = path.resolve(current, '..');
      if (current == parent) {
        throw new Error(
          `Cannot find 'package.json' in '${initial}' nor any of its parent directories.`
        );
      }
      current = parent;
    }
    if (!pkg.name) {
      throw new Error(`Cannot find property 'name' in '${pathname}'.`);
    }
    return {
      name: pkg.name,
      version: pkg.version,
      directory: current,
      resolve: function() {
        return path.resolve.apply(path, [current].concat(Array.prototype.slice.call(arguments)));
      },
      relative: function(to) {
        return path.relative(current, to);
      },
      prop: function(name) {
        const value = pkg[name];
        if (value === undefined) {
          throw new Error(`Cannot find property '${name}' in '${pathname}'.`);
        }
        return value;
      }
    };
  }