npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

@vltpkg/types

1.0.0-rc.13

@GitHub Actions

npmHomeRepoSnykSocket
Downloads:112391
$ npm install @vltpkg/types
DailyWeeklyMonthlyYearly

types

@vltpkg/types

A module for a handful of core types that are used throughout vlt extensively, and don't belong to any one particular implementation.

Usage

import {
  type Manifest,
  type Packument,
  type Integrity,
  type Signature,
  isManifest,
  isPackument,
  isIntegrity,
} from '@vltpkg/types'

const mani: Manifest = {
  name: 'hello',
  version: '1.2.3',
  dist: {
    tarball: 'https://example.com/hello-1.2.3.tgz',
    integrity: 'sha512-3yWxPTq3Uq/imagine/if/this/was/the/integrity/wow/it/could/happen/just/very/unlikely/00==',
  },
}
mani.dist.integrity
//        ^? Integrity | undefined
const someRandomObject = {
  name: 'foo',
  version: '1.2.3',
}
if (isManifest(someRandomObject)) {
  someRandomObject
  // ^? Manifest
}