function ls( options ) {
	var names;
	var opts;
	var err;

	opts = copy( defaults );
	if ( arguments.length ) {
		err = validate( opts, options );
		if ( err ) {
			throw err;
		}
	}
	debug( 'Options: %s', JSON.stringify( opts ) );

	opts.dir = getRoot( opts.dir || '' );
	debug( 'Base directory: %s', opts.dir );

	debug( 'Resolving packages...' );
	names = pkgNames( opts );
	if ( names instanceof Error ) {
		debug( 'Encountered an error when resolving packages: %s', names.message );
		throw names;
	}
	debug( 'Successfully resolved %d packages.', names.length );
	if ( names.length === 0 ) {
		return names;
	}
	debug( 'Packages: %s', names.join( ', ' ) );

	debug( 'Filtering packages...' );
	names = filter( names, opts.dir );
	if ( names instanceof Error ) {
		debug( 'Encountered an error when filtering packages: %s', names.message );
		throw names;
	}
	debug( 'Successfully filtered packages.' );
	debug( 'Packages: %s', names.join( ', ' ) );
	return names;
}
Synchronously lists stdlib packages which are compatible with browser environments.

@param {Options} [options] - function options
@param {string} [options.dir] - root directory from which to search for packages
@param {string} [options.pattern='**\/package.json'] - glob pattern
@param {StringArray} [options.ignore] - glob pattern(s) to exclude matches
@throws {TypeError} options argument must be an object
@throws {TypeError} must provide valid options
@throws {Error} `pattern` option must end with `package.json`
@throws {Error} unexpected error
@returns {StringArray} list of names

@example
var names = ls();
// returns [...]