function pkgs() {
	var options;
	var clbk;
	var opts;
	var err;

	opts = copy( DEFAULTS );
	if ( arguments.length < 2 ) {
		clbk = arguments[ 0 ];
	} else {
		options = arguments[ 0 ];
		clbk = arguments[ 1 ];
		err = validate( opts, options );
		if ( err ) {
			throw err;
		}
	}
	if ( !isFunction( clbk ) ) {
		throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );
	}
	if ( opts.dir ) {
		opts.dir = resolve( cwd(), opts.dir );
	} else {
		opts.dir = cwd();
	}
	if ( opts.depth === null ) {
		opts.depth = PINF;
	}
	debug( 'Options: %s.', JSON.stringify( opts ) );
	options = {
		'depth': opts.depth,
		'dev': opts.dev,
		'log': createDebug( 'installed-pkgs:read-installed' )
	};

	debug( 'Reading installed packages...' );
	readInstalled( opts.dir, options, onRead );

	/**
	* Callback invoked after reading installed packages.
	*
	* @private
	* @param {(Error|null)} error - error object
	* @param {Object} results - results
	* @returns {void}
	*/
	function onRead( error, results ) {
		if ( error ) {
			debug( 'Encountered an error while attempting to read installed packages: %s.', error.message );
			return done( error );
		}
		debug( 'Successfully read installed packages.' );
		results = recurse( {}, results );
		done( null, toArray( results ) );
	}

	/**
	* Callback invoked after generating a list of package dependencies.
	*
	* @private
	* @param {(Error|null)} error - error object
	* @param {(StringArray|EmptyArray)} results - results
	* @returns {void}
	*/
	function done( error, results ) {
		if ( error ) {
			debug( 'Encountered an error while generating a list of package dependencies: %s.', error.message );
			return clbk( error );
		}
		debug( 'Finished resolving package dependencies.' );
		clbk( null, results );
	}
}
Generates a list of installed package dependencies.

@param {Options} options - function options
@param {string} [options.dir] - root directory from which to search
@param {NonNegativeInteger} [options.depth] - search depth
@param {boolean} [options.dev=true] - boolean indicating whether to include dev dependencies
@param {Callback} clbk - callback to invoke upon completion
@throws {TypeError} options argument must be an object
@throws {TypeError} must provide valid options
@throws {TypeError} must provide a function

@example
pkgs( onPkgs );

function onPkgs( error, list ) {
    if ( error ) {
        throw error;
    }
    console.dir( list );
}