1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. artifactregistry
  5. getNpmPackages
Google Cloud v9.3.0 published on Tuesday, Oct 7, 2025 by Pulumi

gcp.artifactregistry.getNpmPackages

Deploy with Pulumi
gcp logo
Google Cloud v9.3.0 published on Tuesday, Oct 7, 2025 by Pulumi

    Get information about Artifact Registry Npm packages. See the official documentation and API.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const myPackages = gcp.artifactregistry.getNpmPackages({
        location: "us-central1",
        repositoryId: "example-repo",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_packages = gcp.artifactregistry.get_npm_packages(location="us-central1",
        repository_id="example-repo")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/artifactregistry"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := artifactregistry.GetNpmPackages(ctx, &artifactregistry.GetNpmPackagesArgs{
    			Location:     "us-central1",
    			RepositoryId: "example-repo",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var myPackages = Gcp.ArtifactRegistry.GetNpmPackages.Invoke(new()
        {
            Location = "us-central1",
            RepositoryId = "example-repo",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.artifactregistry.ArtifactregistryFunctions;
    import com.pulumi.gcp.artifactregistry.inputs.GetNpmPackagesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var myPackages = ArtifactregistryFunctions.getNpmPackages(GetNpmPackagesArgs.builder()
                .location("us-central1")
                .repositoryId("example-repo")
                .build());
    
        }
    }
    
    variables:
      myPackages:
        fn::invoke:
          function: gcp:artifactregistry:getNpmPackages
          arguments:
            location: us-central1
            repositoryId: example-repo
    

    Using getNpmPackages

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getNpmPackages(args: GetNpmPackagesArgs, opts?: InvokeOptions): Promise<GetNpmPackagesResult>
    function getNpmPackagesOutput(args: GetNpmPackagesOutputArgs, opts?: InvokeOptions): Output<GetNpmPackagesResult>
    def get_npm_packages(location: Optional[str] = None,
                         project: Optional[str] = None,
                         repository_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetNpmPackagesResult
    def get_npm_packages_output(location: Optional[pulumi.Input[str]] = None,
                         project: Optional[pulumi.Input[str]] = None,
                         repository_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetNpmPackagesResult]
    func GetNpmPackages(ctx *Context, args *GetNpmPackagesArgs, opts ...InvokeOption) (*GetNpmPackagesResult, error)
    func GetNpmPackagesOutput(ctx *Context, args *GetNpmPackagesOutputArgs, opts ...InvokeOption) GetNpmPackagesResultOutput

    > Note: This function is named GetNpmPackages in the Go SDK.

    public static class GetNpmPackages 
    {
        public static Task<GetNpmPackagesResult> InvokeAsync(GetNpmPackagesArgs args, InvokeOptions? opts = null)
        public static Output<GetNpmPackagesResult> Invoke(GetNpmPackagesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNpmPackagesResult> getNpmPackages(GetNpmPackagesArgs args, InvokeOptions options)
    public static Output<GetNpmPackagesResult> getNpmPackages(GetNpmPackagesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:artifactregistry/getNpmPackages:getNpmPackages
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Location string
    The location of the Artifact Registry repository.
    RepositoryId string
    The last part of the repository name to fetch from.
    Project string
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    Location string
    The location of the Artifact Registry repository.
    RepositoryId string
    The last part of the repository name to fetch from.
    Project string
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location of the Artifact Registry repository.
    repositoryId String
    The last part of the repository name to fetch from.
    project String
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    location string
    The location of the Artifact Registry repository.
    repositoryId string
    The last part of the repository name to fetch from.
    project string
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    location str
    The location of the Artifact Registry repository.
    repository_id str
    The last part of the repository name to fetch from.
    project str
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location of the Artifact Registry repository.
    repositoryId String
    The last part of the repository name to fetch from.
    project String
    The project ID in which the resource belongs. If it is not provided, the provider project is used.

    getNpmPackages Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    NpmPackages List<GetNpmPackagesNpmPackage>
    A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
    RepositoryId string
    Project string
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    NpmPackages []GetNpmPackagesNpmPackage
    A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
    RepositoryId string
    Project string
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    npmPackages List<GetNpmPackagesNpmPackage>
    A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
    repositoryId String
    project String
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    npmPackages GetNpmPackagesNpmPackage[]
    A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
    repositoryId string
    project string
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    npm_packages Sequence[GetNpmPackagesNpmPackage]
    A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
    repository_id str
    project str
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    npmPackages List<Property Map>
    A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
    repositoryId String
    project String

    Supporting Types

    GetNpmPackagesNpmPackage

    CreateTime string
    The time, as a RFC 3339 string, this package was created.
    Name string
    The fully qualified name of the fetched package. This name has the form: projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}. For example, projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
    PackageName string
    Extracted short name of the package (last part of name, without version). For example, from .../my-test-package:0.0.1my-test-package.
    Tags List<string>
    The tags associated with the Npm package.
    UpdateTime string
    The time, as a RFC 3339 string, this package was updated.
    Version string
    Version of this package.
    CreateTime string
    The time, as a RFC 3339 string, this package was created.
    Name string
    The fully qualified name of the fetched package. This name has the form: projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}. For example, projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
    PackageName string
    Extracted short name of the package (last part of name, without version). For example, from .../my-test-package:0.0.1my-test-package.
    Tags []string
    The tags associated with the Npm package.
    UpdateTime string
    The time, as a RFC 3339 string, this package was updated.
    Version string
    Version of this package.
    createTime String
    The time, as a RFC 3339 string, this package was created.
    name String
    The fully qualified name of the fetched package. This name has the form: projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}. For example, projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
    packageName String
    Extracted short name of the package (last part of name, without version). For example, from .../my-test-package:0.0.1my-test-package.
    tags List<String>
    The tags associated with the Npm package.
    updateTime String
    The time, as a RFC 3339 string, this package was updated.
    version String
    Version of this package.
    createTime string
    The time, as a RFC 3339 string, this package was created.
    name string
    The fully qualified name of the fetched package. This name has the form: projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}. For example, projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
    packageName string
    Extracted short name of the package (last part of name, without version). For example, from .../my-test-package:0.0.1my-test-package.
    tags string[]
    The tags associated with the Npm package.
    updateTime string
    The time, as a RFC 3339 string, this package was updated.
    version string
    Version of this package.
    create_time str
    The time, as a RFC 3339 string, this package was created.
    name str
    The fully qualified name of the fetched package. This name has the form: projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}. For example, projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
    package_name str
    Extracted short name of the package (last part of name, without version). For example, from .../my-test-package:0.0.1my-test-package.
    tags Sequence[str]
    The tags associated with the Npm package.
    update_time str
    The time, as a RFC 3339 string, this package was updated.
    version str
    Version of this package.
    createTime String
    The time, as a RFC 3339 string, this package was created.
    name String
    The fully qualified name of the fetched package. This name has the form: projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}. For example, projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
    packageName String
    Extracted short name of the package (last part of name, without version). For example, from .../my-test-package:0.0.1my-test-package.
    tags List<String>
    The tags associated with the Npm package.
    updateTime String
    The time, as a RFC 3339 string, this package was updated.
    version String
    Version of this package.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud v9.3.0 published on Tuesday, Oct 7, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate