New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@code-pushup/models

Package Overview
Dependencies
Maintainers
3
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@code-pushup/models

Model definitions and validators for the Code PushUp CLI

  • 0.60.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

@code-pushup/models

npm downloads dependencies

Model definitions and validators for the Code PushUp CLI.

For a full list of models defined by this package, see the auto-generated Code PushUp models reference.

Setup

If you've already installed another @code-pushup/* package, then you may have already installed @code-pushup/models indirectly.

If not, you can always install it separately:

npm install --save-dev @code-pushup/models
yarn add --dev @code-pushup/models
pnpm add --save-dev @code-pushup/models

Usage

Import the type definitions if using TypeScript:

  • in code-pushup.config.ts:

    import type { CoreConfig } from '@code-pushup/models';
    
    export default {
      // ... this is type-checked ...
    } satisfies CoreConfig;
    
  • in custom plugin:

    import type { PluginConfig } from '@code-pushup/models';
    
    export default function myCustomPlugin(): PluginConfig {
      return {
        // ... this is type-checked ...
      };
    }
    
    import type { AuditOutput } from '@code-pushup/models';
    
    async function myCustomPluginRunner() {
      const audits: AuditOutput[] = await collectAudits();
    
      await writeFile(RUNNER_OUTPUT_FILE, JSON.strinfigy(audits));
    }
    

If you need runtime validation, use the underlying Zod schemas:

import { coreConfigSchema } from '@code-pushup/models';

const json = JSON.parse(readFileSync('code-pushup.config.json'));
const config = coreConfigSchema.parse(json); // throws ZodError if invalid

Keywords

FAQs

Package last updated on 18 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc