@Generated(value="jsii-pacmak/1.47.0 (build 86d2c33)", date="2021-12-20T00:39:28.844Z") @Stability(value=Experimental) public class NodePackage extends Component
| Modifier and Type | Class and Description |
|---|---|
static class |
NodePackage.Builder
(experimental) A fluent builder for
NodePackage. |
| Modifier | Constructor and Description |
|---|---|
protected |
NodePackage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
NodePackage(software.amazon.jsii.JsiiObjectRef objRef) |
|
NodePackage(Project project) |
|
NodePackage(Project project,
NodePackageOptions options) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBin(Map<String,String> bins) |
void |
addBundledDeps(String... deps)
(experimental) Defines bundled dependencies.
|
void |
addDeps(String... deps)
(experimental) Defines normal dependencies.
|
void |
addDevDeps(String... deps)
(experimental) Defines development/test dependencies.
|
void |
addEngine(String engine,
String version)
(experimental) Adds an `engines` requirement to your package.
|
void |
addField(String name,
Object value)
(experimental) Directly set fields in `package.json`.
|
void |
addKeywords(String... keywords)
(experimental) Adds keywords to package.json (deduplicated).
|
void |
addPeerDeps(String... deps)
(experimental) Defines peer dependencies.
|
void |
addVersion(String version)
(experimental) Sets the package version.
|
Boolean |
getAllowLibraryDependencies()
(experimental) Allow project to take library dependencies.
|
CodeArtifactOptions |
getCodeArtifactOptions()
(experimental) Options for publishing npm package to AWS CodeArtifact.
|
String |
getEntrypoint()
(experimental) The module's entrypoint (e.g.
|
String |
getInstallAndUpdateLockfileCommand()
(experimental) Renders `yarn install` or `npm install` with lockfile update (not frozen).
|
String |
getInstallCommand()
(experimental) Returns the command to execute in order to install all dependencies (always frozen).
|
String |
getLicense()
(experimental) The SPDX license of this module.
|
String |
getLockFile()
(experimental) The name of the lock file.
|
Object |
getManifest()
Deprecated.
use `addField(x, y)`
|
String |
getMaxNodeVersion()
(experimental) Maximum node version required by this pacakge.
|
String |
getMinNodeVersion()
(experimental) Minimum node.js version required by this package.
|
NpmAccess |
getNpmAccess()
(experimental) npm package access level.
|
String |
getNpmRegistry()
(experimental) The npm registry host (e.g.
|
String |
getNpmRegistryUrl()
(experimental) npm registry (e.g.
|
String |
getNpmTokenSecret()
(experimental) GitHub secret which contains the NPM token to use when publishing packages.
|
NodePackageManager |
getPackageManager()
(experimental) The package manager to use.
|
String |
getPackageName()
(experimental) The name of the npm package.
|
String |
getProjenCommand()
(experimental) The command which executes "projen".
|
Boolean |
hasScript(String name)
Deprecated.
Use `project.tasks.tryFind(name)`
|
void |
postSynthesize()
(experimental) Called after synthesis.
|
void |
preSynthesize()
(experimental) Called before synthesis.
|
void |
removeScript(String name)
(experimental) Removes the npm script (always successful).
|
String |
renderUpgradePackagesCommand(List<String> exclude)
(experimental) Render a package manager specific command to upgrade all requested dependencies.
|
String |
renderUpgradePackagesCommand(List<String> exclude,
List<String> include)
(experimental) Render a package manager specific command to upgrade all requested dependencies.
|
void |
setScript(String name,
String command)
(experimental) Override the contents of an npm package.json script.
|
getProject, synthesizejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected NodePackage(software.amazon.jsii.JsiiObjectRef objRef)
protected NodePackage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public NodePackage(@NotNull
Project project,
@Nullable
NodePackageOptions options)
project - This parameter is required.options - @Stability(value=Experimental)
public NodePackage(@NotNull
Project project)
project - This parameter is required.@Stability(value=Experimental)
public void addBin(@NotNull
Map<String,String> bins)
bins - This parameter is required.@Stability(value=Experimental)
public void addBundledDeps(@NotNull
String... deps)
Bundled dependencies will be added as normal dependencies as well as to the
bundledDependencies section of your package.json.
deps - Names modules to install. This parameter is required.@Stability(value=Experimental)
public void addDeps(@NotNull
String... deps)
deps - Names modules to install. This parameter is required.@Stability(value=Experimental)
public void addDevDeps(@NotNull
String... deps)
deps - Names modules to install. This parameter is required.@Stability(value=Experimental)
public void addEngine(@NotNull
String engine,
@NotNull
String version)
engine - The engine (e.g. `node`). This parameter is required.version - The semantic version requirement (e.g. `^10`). This parameter is required.@Stability(value=Experimental)
public void addField(@NotNull
String name,
@NotNull
Object value)
name - field name. This parameter is required.value - field value. This parameter is required.@Stability(value=Experimental)
public void addKeywords(@NotNull
String... keywords)
keywords - The keywords to add. This parameter is required.@Stability(value=Experimental)
public void addPeerDeps(@NotNull
String... deps)
When adding peer dependencies, a devDependency will also be added on the pinned version of the declared peer. This will ensure that you are testing your code against the minimum version required from your consumers.
deps - Names modules to install. This parameter is required.@Stability(value=Experimental)
public void addVersion(@NotNull
String version)
version - Package version. This parameter is required.@Stability(value=Deprecated) @Deprecated @NotNull public Boolean hasScript(@NotNull String name)
name - The name of the script. This parameter is required.@Stability(value=Experimental) public void postSynthesize()
Order is not guaranteed.
postSynthesize in class Component@Stability(value=Experimental) public void preSynthesize()
preSynthesize in class Component@Stability(value=Experimental)
public void removeScript(@NotNull
String name)
name - The name of the script. This parameter is required.@Stability(value=Experimental) @NotNull public String renderUpgradePackagesCommand(@NotNull List<String> exclude, @Nullable List<String> include)
exclude - This parameter is required.include - @Stability(value=Experimental) @NotNull public String renderUpgradePackagesCommand(@NotNull List<String> exclude)
exclude - This parameter is required.@Stability(value=Experimental)
public void setScript(@NotNull
String name,
@NotNull
String command)
name - The script name. This parameter is required.command - The command to execute. This parameter is required.@Stability(value=Experimental) @NotNull public Boolean getAllowLibraryDependencies()
@Stability(value=Experimental) @NotNull public String getEntrypoint()
@Stability(value=Experimental) @NotNull public String getInstallAndUpdateLockfileCommand()
@Stability(value=Experimental) @NotNull public String getInstallCommand()
@Stability(value=Experimental) @NotNull public String getLockFile()
@Stability(value=Deprecated) @Deprecated @NotNull public Object getManifest()
@Stability(value=Experimental) @NotNull public NpmAccess getNpmAccess()
@Stability(value=Experimental) @NotNull public String getNpmRegistry()
@Stability(value=Experimental) @NotNull public String getNpmRegistryUrl()
@Stability(value=Experimental) @NotNull public NodePackageManager getPackageManager()
@Stability(value=Experimental) @NotNull public String getPackageName()
@Stability(value=Experimental) @NotNull public String getProjenCommand()
@Stability(value=Experimental) @Nullable public CodeArtifactOptions getCodeArtifactOptions()
Default: - undefined
@Stability(value=Experimental) @Nullable public String getLicense()
undefined if this package is not licensed.
@Stability(value=Experimental) @Nullable public String getMaxNodeVersion()
Default: - no maximum.
@Stability(value=Experimental) @Nullable public String getMinNodeVersion()
Default: - no minimum
@Stability(value=Experimental) @Nullable public String getNpmTokenSecret()
Copyright © 2021. All rights reserved.