• Type: {string}
    1. {
    2. "main": "./main.js"
    3. }

    The "main" field defines the script that is used when the package directory is loaded via require(). Its value is a path.

    1. require('./path/to/directory'); // This resolves to ./path/to/directory/main.js.

    When a package has an ["exports"][] field, this will take precedence over the "main" field when importing the package by name.