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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sigstore/tuf

v2.3.4

Published

Client for the Sigstore TUF repository

Downloads

18,902,830

Readme

@sigstore/tuf · npm version CI Status Smoke Test Status

A JavaScript library for securely retrieving targets from the Sigstore TUF repository.

Features

  • Embeds the trutsted root metadata file necessary to bootstrap interaction with the Sigstore TUF repository.
  • Automatically initializes the local TUF cache for storing metadata and target files.

Prerequisites

  • Node.js version >= 16.14.0

Installation

npm install @sigstore/tuf

Usage

const { initTUF } = require('@sigstore/tuf');
import { initTUF } from '@sigstore/tuf';

initTUF([options])

Returns a TUF client which can be used to retrieve any target from the Sigstore TUF repository. The local TUF cache will be initialized and the TUF metadata files downloaded from the remote repository as part of the initialization process.

  • options <Object>
    • mirrorURL <string>: Base URL for the Sigstore TUF repository. Defaults to 'https://tuf-repo-cdn.sigstore.dev'
    • cachePath <string>: Absolute path to the directory to be used for caching downloaded TUF metadata and targets. Defaults to a directory named "sigstore-js" within the platform-specific application data directory.
    • rootPath <string>: Path to the initial trust root for the TUF repository. Defaults to the embedded root.
    • forceInit boolean: Force re-initialization of the TUF cache even if it already exists. Defaults to false.
    • forceCache boolean: Prevents any downloads from the remote TUF repository as long as all cached metadata files are un-expired. Defaults to false.
    • force boolean: Same as forceInit (deprecated).

The TUF client object returned from initTUF has a single getTarget function which takes the name of a target in the Sigstore TUF repository and returns the content of that target.

getTrustedRoot([options])

Retrieves the most recent version of the "trusted_root.json" target from the Sigstore TUF repository. The format of "trusted_root.json" file is described by the TrustedRoot protobuf and contains the complete set of trusted verification materials for the Sigstore public-good instance.

  • options <Object>
    • mirrorURL <string>: Base URL for the Sigstore TUF repository. Defaults to 'https://tuf-repo-cdn.sigstore.dev'
    • cachePath <string>: Absolute path to the directory to be used for caching downloaded TUF metadata and targets. Defaults to a directory named "sigstore-js" within the platform-specific application data directory.
    • rootPath <string>: Path to the initial trust root for the TUF repository. Defaults to the embedded root.
    • forceInit boolean: Force re-initialization of the TUF cache even if it already exists. Defaults to false.
    • forceCache boolean: Prevents any downloads from the remote TUF repository as long as all cached metadata files are un-expired. Defaults to false.
    • force boolean: Same as forceInit (deprecated).