docs: async function nResolve(id: string, options?: Options): Promise<string> { // eslint-disable-line no-use-before-define
  	assert(typeof id === 'string' && id.length > 0, '<id> has to be a non-empty string');
  	assert(typeof options === 'object' && !Array.isArray(options), '[options] has to be an object');
  
  	const s = getSettings(options);
  	assert(nonEmpty(s.base), 'options.base has to be a non-empty string');
  	assert(nonEmpty(s.index), 'options.index has to be a non-empty string');
  	assert(nonEmpty(s.resolveKey), 'options.resolveKey has to be a non-empty string');
  	assert(plain(s.package), 'options.package has to be an object');
  	assert(plain(s.modules), 'options.modules has to be an object');
  
  	if (s.modules[id]) {
  		return s.modules[id];
  	}
  
  	if (isBuiltin(id)) {
  		return id;
  	}
  
  	const [name, ...rest] = id.split('/').filter(Boolean);
  	const isRelative = name === '.' || name === '..';
  
  	const modulePath = isRelative ?
  		path.resolve(s.base, name) :
  		await getModulePath(name, s);
  
  	const relativeBase = s.filename ?
  		path.dirname(s.filename) :
  		s.base;
  
  	const relativePath = rest.length ?
  		path.resolve(relativeBase, ...rest) :
  		await getMainPath(modulePath, s);
  
  	const moduleRelativePath = path.extname(relativePath) === '' ?
  		`${relativePath}.js` : relativePath;
  
  	const moduleFilePath = path.resolve(modulePath, moduleRelativePath);
  
  	if (!(await exists(moduleFilePath))) {
  		const nameDesc = isRelative ? '' : ` in ${name}`;
  		throw new Error(`Could not find ${moduleFilePath}${nameDesc} at ${modulePath}`);
  	}
  
  	const parsed = path.parse(moduleFilePath);
  	const ext = parsed.ext === '.js' ? '' : parsed.ext;
  
  	return path.format({
  		dir: parsed.dir,
  		base: `${parsed.name}${ext}`
  	});
  }