Class that stores information about a node_modules directory (i.e., the packages and subdirectories in the directory). It is one of the two types of entries in a PackageInfoCache. It is only created by the PackageInfoCache.

Method Summary

Public Methods
public
findPackage(packageName):

Return a PackageInfo object for a given package name (which may include a scope)

public

Indicate if there are any errors in the NodeModulesList itself (not including errors within the individual entries).

Protected Methods
protected
addEntry(entryName, entryVal)

Add an entry (PackageInfo or NodeModulesList instance) to the entries for this list. This is only called by PackageInfoCache. It is not intended to be called directly by anything else.

protected
addError(errorType, errorData)

Given error data, add an ErrorEntry to the ErrorList for this object.

Public Methods

Return a PackageInfo object for a given package name (which may include a scope)

Parameters:

Name Type Attribute Description
packageName String

the name (possibly including a scope) of the PackageInfo the caller wants returned.

Return:

the desired PackageInfo if one exists for the given name, else null.

Indicate if there are any errors in the NodeModulesList itself (not including errors within the individual entries).

Protected Methods

lib/models/package-info-cache/node-modules-list.js:67

protected addEntry(entryName, entryVal)

Add an entry (PackageInfo or NodeModulesList instance) to the entries for this list. This is only called by PackageInfoCache. It is not intended to be called directly by anything else.

Parameters:

Name Type Attribute Description
entryName String

the name of the entry, i.e., the name of the file or subdirectory in the directory listing.

entryVal Object

the PackageInfo or NodeModulesList tha corresponds to the given entry name in the file system.

lib/models/package-info-cache/node-modules-list.js:43

protected addError(errorType, errorData)

Given error data, add an ErrorEntry to the ErrorList for this object.

Parameters:

Name Type Attribute Description
errorType String

one of the Errors.ERROR_* constants.

errorData Object

any error data relevant to the type of error being created. See showErrors().