Interface NodePackageOptions

    • Method Detail

      • getAllowLibraryDependencies

        @Stability(Experimental)
        @Nullable
        default Boolean getAllowLibraryDependencies()
        (experimental) Allow the project to include peerDependencies and bundledDependencies.

        This is normally only allowed for libraries. For apps, there's no meaning for specifying these.

        Default: true

      • getAuthorEmail

        @Stability(Experimental)
        @Nullable
        default String getAuthorEmail()
        (experimental) Author's e-mail.
      • getAuthorName

        @Stability(Experimental)
        @Nullable
        default String getAuthorName()
        (experimental) Author's name.
      • getAuthorOrganization

        @Stability(Experimental)
        @Nullable
        default Boolean getAuthorOrganization()
        (experimental) Is the author an organization.
      • getAuthorUrl

        @Stability(Experimental)
        @Nullable
        default String getAuthorUrl()
        (experimental) Author's URL / Website.
      • getAutoDetectBin

        @Stability(Experimental)
        @Nullable
        default Boolean getAutoDetectBin()
        (experimental) Automatically add all executables under the bin directory to your package.json file under the bin section.

        Default: true

      • getBin

        @Stability(Experimental)
        @Nullable
        default Map<String,​String> getBin()
        (experimental) Binary programs vended with your module.

        You can use this option to add/customize how binaries are represented in your package.json, but unless autoDetectBin is false, every executable file under bin will automatically be added to this section.

      • getBugsEmail

        @Stability(Experimental)
        @Nullable
        default String getBugsEmail()
        (experimental) The email address to which issues should be reported.
      • getBugsUrl

        @Stability(Experimental)
        @Nullable
        default String getBugsUrl()
        (experimental) The url to your project's issue tracker.
      • getBundledDeps

        @Stability(Experimental)
        @Nullable
        default List<String> getBundledDeps()
        (experimental) List of dependencies to bundle into this module.

        These modules will be added both to the dependencies section and bundledDependencies section of your package.json.

        The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.

      • getCodeArtifactOptions

        @Stability(Experimental)
        @Nullable
        default CodeArtifactOptions getCodeArtifactOptions()
        (experimental) Options for npm packages using AWS CodeArtifact.

        This is required if publishing packages to, or installing scoped packages from AWS CodeArtifact

        Default: - undefined

      • getDeps

        @Stability(Experimental)
        @Nullable
        default List<String> getDeps()
        (experimental) Runtime dependencies of this module.

        The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.

        Default: []

        Example:

         [ 'express', 'lodash', 'foo@^2' ]
         
      • getDescription

        @Stability(Experimental)
        @Nullable
        default String getDescription()
        (experimental) The description is just a string that helps people understand the purpose of the package.

        It can be used when searching for packages in a package manager as well. See https://classic.yarnpkg.com/en/docs/package-json/#toc-description

      • getDevDeps

        @Stability(Experimental)
        @Nullable
        default List<String> getDevDeps()
        (experimental) Build dependencies for this module.

        These dependencies will only be available in your build environment but will not be fetched when this module is consumed.

        The recommendation is to only specify the module name here (e.g. express). This will behave similar to yarn add or npm install in the sense that it will add the module as a dependency to your package.json file with the latest version (^). You can specify semver requirements in the same syntax passed to npm i or yarn add (e.g. express@^2) and this will be what you package.json will eventually include.

        Default: []

        Example:

         [ 'typescript', '@types/express' ]
         
      • getEntrypoint

        @Stability(Experimental)
        @Nullable
        default String getEntrypoint()
        (experimental) Module entrypoint (main in package.json).

        Set to an empty string to not include main in your package.json

        Default: "lib/index.js"

      • getHomepage

        @Stability(Experimental)
        @Nullable
        default String getHomepage()
        (experimental) Package's Homepage / Website.
      • getKeywords

        @Stability(Experimental)
        @Nullable
        default List<String> getKeywords()
        (experimental) Keywords to include in package.json.
      • getLicense

        @Stability(Experimental)
        @Nullable
        default String getLicense()
        (experimental) License's SPDX identifier.

        See https://github.com/projen/projen/tree/main/license-text for a list of supported licenses. Use the licensed option if you want to no license to be specified.

        Default: "Apache-2.0"

      • getLicensed

        @Stability(Experimental)
        @Nullable
        default Boolean getLicensed()
        (experimental) Indicates if a license should be added.

        Default: true

      • getMaxNodeVersion

        @Stability(Experimental)
        @Nullable
        default String getMaxNodeVersion()
        (experimental) Minimum node.js version to require via engines (inclusive).

        Default: - no max

      • getMinNodeVersion

        @Stability(Experimental)
        @Nullable
        default String getMinNodeVersion()
        (experimental) Minimum Node.js version to require via package.json engines (inclusive).

        Default: - no "engines" specified

      • getNpmAccess

        @Stability(Experimental)
        @Nullable
        default NpmAccess getNpmAccess()
        (experimental) Access level of the npm package.

        Default: - for scoped packages (e.g. `foo@bar`), the default is `NpmAccess.RESTRICTED`, for non-scoped packages, the default is `NpmAccess.PUBLIC`.

      • getNpmProvenance

        @Stability(Experimental)
        @Nullable
        default Boolean getNpmProvenance()
        (experimental) Should provenance statements be generated when the package is published.

        A supported package manager is required to publish a package with npm provenance statements and you will need to use a supported CI/CD provider.

        Note that the projen Release and Publisher components are using publib to publish packages, which is using npm internally and supports provenance statements independently of the package manager used.

        Default: - true for public packages, false otherwise

        See Also:
        https://docs.npmjs.com/generating-provenance-statements
      • getNpmRegistry

        @Stability(Deprecated)
        @Deprecated
        @Nullable
        default String getNpmRegistry()
        Deprecated.
        use npmRegistryUrl instead
        (deprecated) The host name of the npm registry to publish to.

        Cannot be set together with npmRegistryUrl.

      • getNpmRegistryUrl

        @Stability(Experimental)
        @Nullable
        default String getNpmRegistryUrl()
        (experimental) The base URL of the npm package registry.

        Must be a URL (e.g. start with "https://" or "http://")

        Default: "https://registry.npmjs.org"

      • getNpmTokenSecret

        @Stability(Experimental)
        @Nullable
        default String getNpmTokenSecret()
        (experimental) GitHub secret which contains the NPM token to use when publishing packages.

        Default: "NPM_TOKEN"

      • getPackageManager

        @Stability(Experimental)
        @Nullable
        default NodePackageManager getPackageManager()
        (experimental) The Node Package Manager used to execute scripts.

        Default: NodePackageManager.YARN_CLASSIC

      • getPackageName

        @Stability(Experimental)
        @Nullable
        default String getPackageName()
        (experimental) The "name" in package.json.

        Default: - defaults to project name

      • getPeerDependencyOptions

        @Stability(Experimental)
        @Nullable
        default PeerDependencyOptions getPeerDependencyOptions()
        (experimental) Options for peerDeps.
      • getPeerDeps

        @Stability(Experimental)
        @Nullable
        default List<String> getPeerDeps()
        (experimental) Peer dependencies for this module.

        Dependencies listed here are required to be installed (and satisfied) by the consumer of this library. Using peer dependencies allows you to ensure that only a single module of a certain library exists in the node_modules tree of your consumers.

        Note that prior to npm@7, peer dependencies are not automatically installed, which means that adding peer dependencies to a library will be a breaking change for your customers.

        Unless peerDependencyOptions.pinnedDevDependency is disabled (it is enabled by default), projen will automatically add a dev dependency with a pinned version for each peer dependency. This will ensure that you build & test your module against the lowest peer version required.

        Default: []

      • getPnpmVersion

        @Stability(Experimental)
        @Nullable
        default String getPnpmVersion()
        (experimental) The version of PNPM to use if using PNPM as a package manager.

        Default: "7"

      • getRepository

        @Stability(Experimental)
        @Nullable
        default String getRepository()
        (experimental) The repository is the location where the actual code for your package lives.

        See https://classic.yarnpkg.com/en/docs/package-json/#toc-repository

      • getRepositoryDirectory

        @Stability(Experimental)
        @Nullable
        default String getRepositoryDirectory()
        (experimental) If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives.
      • getScopedPackagesOptions

        @Stability(Experimental)
        @Nullable
        default List<ScopedPackagesOptions> getScopedPackagesOptions()
        (experimental) Options for privately hosted scoped packages.

        Default: - fetch all scoped packages from the public npm registry

      • getScripts

        @Stability(Deprecated)
        @Deprecated
        @Nullable
        default Map<String,​String> getScripts()
        Deprecated.
        use project.addTask() or package.setScript()
        (deprecated) npm scripts to include.

        If a script has the same name as a standard script, the standard script will be overwritten. Also adds the script as a task.

        Default: {}

      • getStability

        @Stability(Experimental)
        @Nullable
        default String getStability()
        (experimental) Package's Stability.
      • getYarnBerryOptions

        @Stability(Experimental)
        @Nullable
        default YarnBerryOptions getYarnBerryOptions()
        (experimental) Options for Yarn Berry.

        Default: - Yarn Berry v4 with all default options