npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@crossplane-models/crossplane

v2.1.3-build.2

Published

Crossplane

Readme

Typescript Models for Crossplane

This model contains the core Crossplane CRDs defined at https://github.com/crossplane/crossplane/tree/main/cluster/crds.

Resources CompositionRevision, ConfigurationRevision, FunctionRevision,PackageRevision, and Lock are actively managed by Crossplane and generally should not be modified by users.

Installation

NPM

npm install @crossplane-models/crossplane

Examples

apiextensions.crossplane.io

Composition

import { dumpYaml } from "@kubernetes/client-node";
import { Composition } from "@crossplane-models/crossplane/gen/apiextensions.crossplane.io/v1";

const composition = new Composition({
    metadata: {
        name: "my-composition",
        labels: {
            "purpose": "example",
        },
    },
    spec: {
        compositeTypeRef: {
            apiVersion: "example.com/v1alpha1",
            kind: "XDatabase",
        },
        mode: "Pipeline",
    },
});

composition.validate();
console.log(dumpYaml(composition));

CompositionRevision

import { dumpYaml } from "@kubernetes/client-node";
import { CompositionRevision } from "@crossplane-models/crossplane/gen/apiextensions.crossplane.io/v1";

const compositionRevision = new CompositionRevision({
    metadata: {
        name: "my-composition-abc123",
        labels: {
            "crossplane.io/composition-name": "my-composition",
        },
    },
    spec: {
        compositeTypeRef: {
            apiVersion: "example.com/v1alpha1",
            kind: "XDatabase",
        },
        revision: 1,
    },
});

compositionRevision.validate();
console.log(dumpYaml(compositionRevision));

CompositeResourceDefinition (XRD)

import { dumpYaml } from "@kubernetes/client-node";
import { CompositeResourceDefinition } from "@crossplane-models/crossplane/gen/apiextensions.crossplane.io/v1";

const xrd = new CompositeResourceDefinition({
    metadata: {
        name: "xdatabases.example.com",
    },
    spec: {
        group: "example.com",
        names: {
            kind: "XDatabase",
            plural: "xdatabases",
        },
        versions: [{
            name: "v1alpha1",
            served: true,
            referenceable: true,
        }],
    },
});

xrd.validate();
console.log(dumpYaml(xrd));

EnvironmentConfig

import { dumpYaml } from "@kubernetes/client-node";
import { EnvironmentConfig } from "@crossplane-models/crossplane/gen/apiextensions.crossplane.io/v1beta1";

const envConfig = new EnvironmentConfig({
    metadata: {
        name: "production-config",
    },
    data: {
        "region": "us-west-2",
        "environment": "production",
    },
});

envConfig.validate();
console.log(dumpYaml(envConfig));

ManagedResourceActivationPolicy

import { dumpYaml } from "@kubernetes/client-node";
import { ManagedResourceActivationPolicy } from "@crossplane-models/crossplane/gen/apiextensions.crossplane.io/v1alpha1";

const activationPolicy = new ManagedResourceActivationPolicy({
    metadata: {
        name: "mr-activation-policy",
    },
    spec: {
        activate: ["*.aws.crossplane.io"],
    },
});

activationPolicy.validate();
console.log(dumpYaml(activationPolicy));

ManagedResourceDefinition

import { dumpYaml } from "@kubernetes/client-node";
import { ManagedResourceDefinition } from "@crossplane-models/crossplane/gen/apiextensions.crossplane.io/v1alpha1";

const mrd = new ManagedResourceDefinition({
    metadata: {
        name: "buckets.s3.aws.example.com",
    },
    spec: {
        group: "s3.aws.example.com",
        scope: "Cluster",
        names: {
            kind: "Bucket",
            plural: "buckets",
        },
        versions: [{
            name: "v1alpha1",
            served: true,
            storage: true,
        }],
    },
});

mrd.validate();
console.log(dumpYaml(mrd));

ops.crossplane.io

CronOperation

import { dumpYaml } from "@kubernetes/client-node";
import { CronOperation } from "@crossplane-models/crossplane/gen/ops.crossplane.io/v1alpha1";

const cronOp = new CronOperation({
    metadata: {
        name: "scheduled-upgrade",
    },
    spec: {
        schedule: "0 2 * * *",
        operationTemplate: {
            spec: {
                mode: "Pipeline",
                pipeline: [{
                    step: "upgrade",
                    functionRef: {
                        name: "function-upgrade",
                    },
                }],
            },
        },
    },
});

cronOp.validate();
console.log(dumpYaml(cronOp));

Operation

import { dumpYaml } from "@kubernetes/client-node";
import { Operation } from "@crossplane-models/crossplane/gen/ops.crossplane.io/v1alpha1";

const operation = new Operation({
    metadata: {
        name: "upgrade-operation",
    },
    spec: {
        mode: "Pipeline",
        pipeline: [{
            step: "upgrade",
            functionRef: {
                name: "function-upgrade",
            },
        }],
    },
});

operation.validate();
console.log(dumpYaml(operation));

WatchOperation

import { dumpYaml } from "@kubernetes/client-node";
import { WatchOperation } from "@crossplane-models/crossplane/gen/ops.crossplane.io/v1alpha1";

const watchOp = new WatchOperation({
    metadata: {
        name: "watch-provider-changes",
    },
    spec: {
        watch: {
            apiVersion: "pkg.crossplane.io/v1",
            kind: "Provider",
        },
        operationTemplate: {
            spec: {
                mode: "Pipeline",
                pipeline: [{
                    step: "upgrade",
                    functionRef: {
                        name: "function-upgrade",
                    },
                }],
            },
        },
    },
});

watchOp.validate();
console.log(dumpYaml(watchOp));

pkg.crossplane.io

Configuration

import { dumpYaml } from "@kubernetes/client-node";
import { Configuration } from "@crossplane-models/crossplane/gen/pkg.crossplane.io/v1";

const config = new Configuration({
    metadata: {
        name: "platform-ref-aws",
    },
    spec: {
        package: "xpkg.upbound.io/upbound/platform-ref-aws:v2.0.0",
        packagePullPolicy: "IfNotPresent",
    },
});

config.validate();
console.log(dumpYaml(config));

ConfigurationRevision

ConfigurationRevisions are managed by Crossplane.

import { dumpYaml } from "@kubernetes/client-node";
import { ConfigurationRevision } from "@crossplane-models/crossplane/gen/pkg.crossplane.io/v1";

const configRevision = new ConfigurationRevision({
    metadata: {
        name: "platform-ref-aws-abc123",
    },
    spec: {
        desiredState: "Active",
        image: "xpkg.upbound.io/upbound/platform-ref-aws:v2.0.0",
        revision: 1,
    },
});

configRevision.validate();
console.log(dumpYaml(configRevision));

DeploymentRuntimeConfig

import { dumpYaml } from "@kubernetes/client-node";
import { DeploymentRuntimeConfig } from "@crossplane-models/crossplane/gen/pkg.crossplane.io/v1beta1";

const drc = new DeploymentRuntimeConfig({
    metadata: {
        name: "drc-example",
    },
    spec: {
        serviceAccountTemplate: {
            metadata: {
                name: "my-service-account",
                labels: {
                    "hello": "world",
                },
            },
        },
    },
});

drc.validate();
console.log(dumpYaml(drc));

Function

Note that Function can cause conflicts with other Typescript types. Import it under a different name, like CrossplaneFunction.

import { dumpYaml } from "@kubernetes/client-node";
import { Function as CrossplaneFunction } from "@crossplane-models/crossplane/gen/pkg.crossplane.io/v1";

const fn = new CrossplaneFunction({
    metadata: {
        name: "function-patch-and-transform",
    },
    spec: {
        package: "xpkg.upbound.io/crossplane-contrib/function-patch-and-transform:v0.1.4",
    },
});

fn.validate();
console.log(dumpYaml(fn));

FunctionRevision

import { dumpYaml } from "@kubernetes/client-node";
import { FunctionRevision } from "@crossplane-models/crossplane/gen/pkg.crossplane.io/v1";

const fnRevision = new FunctionRevision({
    metadata: {
        name: "function-patch-and-transform-abc123",
    },
    spec: {
        desiredState: "Active",
        image: "xpkg.upbound.io/crossplane-contrib/function-patch-and-transform:v0.1.4",
        revision: 1,
    },
});

fnRevision.validate();
console.log(dumpYaml(fnRevision));

ImageConfig

import { dumpYaml } from "@kubernetes/client-node";
import { ImageConfig } from "@crossplane-models/crossplane/gen/pkg.crossplane.io/v1beta1";

const imageConfig = new ImageConfig({
    metadata: {
        name: "private-registry-config",
    },
    spec: {
        matchImages: [{
            prefix: "private.registry.example.com",
        }],
    },
});

imageConfig.validate();
console.log(dumpYaml(imageConfig));

Lock

import { dumpYaml } from "@kubernetes/client-node";
import { Lock } from "@crossplane-models/crossplane/gen/pkg.crossplane.io/v1beta1";

const lock = new Lock({
    metadata: {
        name: "package-lock",
    },
    packages: [{
        name: "provider-aws",
        type: "Provider",
        source: "xpkg.upbound.io/upbound/provider-aws",
        version: "v0.34.0",
        dependencies: [],
    }],
});

lock.validate();
console.log(dumpYaml(lock));

Provider

import { dumpYaml } from "@kubernetes/client-node";
import { Provider } from "@crossplane-models/crossplane/gen/pkg.crossplane.io/v1";

const provider = new Provider({
    metadata: {
        name: "provider-aws",
    },
    spec: {
        package: "xpkg.upbound.io/upbound/provider-aws:v2.3.0",
        packagePullPolicy: "IfNotPresent",
    },
});

provider.validate();
console.log(dumpYaml(provider));

ProviderRevision

import { dumpYaml } from "@kubernetes/client-node";
import { ProviderRevision } from "@crossplane-models/crossplane/gen/pkg.crossplane.io/v1";

const providerRevision = new ProviderRevision({
    metadata: {
        name: "provider-aws-abc123",
    },
    spec: {
        desiredState: "Active",
        image: "xpkg.upbound.io/upbound/provider-aws:v2.3.0",
        revision: 1,
    },
});

providerRevision.validate();
console.log(dumpYaml(providerRevision));

protection.crossplane.io

ClusterUsage

import { dumpYaml } from "@kubernetes/client-node";
import { ClusterUsage } from "@crossplane-models/crossplane/gen/protection.crossplane.io/v1beta1";

const clusterUsage = new ClusterUsage({
    metadata: {
        name: "cluster-database-usage",
    },
    spec: {
        of: {
            apiVersion: "example.com/v1alpha1",
            kind: "Database",
            resourceRef: {
                name: "my-cluster-database",
            },
        },
        by: {
            apiVersion: "example.com/v1alpha1",
            kind: "Application",
            resourceRef: {
                name: "my-cluster-app",
            },
        },
    },
});

clusterUsage.validate();
console.log(dumpYaml(clusterUsage));

Usage

import { dumpYaml } from "@kubernetes/client-node";
import { Usage } from "@crossplane-models/crossplane/gen/protection.crossplane.io/v1beta1";

const usage = new Usage({
    metadata: {
        name: "database-usage",
        namespace: "default",
    },
    spec: {
        of: {
            apiVersion: "example.com/v1alpha1",
            kind: "Database",
            resourceRef: {
                name: "my-database",
            },
        },
        by: {
            apiVersion: "example.com/v1alpha1",
            kind: "Application",
            resourceRef: {
                name: "my-app",
            },
        },
    },
});

usage.validate();
console.log(dumpYaml(usage));

Validation

All models include built-in JSON Schema validation. Call .validate() on any instance to validate against the Crossplane CRD schema. Validation will throw an error if the object doesn't match the schema.