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

@hashicorp/platform-tools

v0.11.0

Published

A collection of tools and utilities for use throughout our projects.

Downloads

16,733

Readme

@hashicorp/platform-tools

A collection of tools and utilities intended for use throughout our applications. Also includes an out-of-the-box script runner which can execute arbitrary TypeScript scripts. This is useful for writing local scripts without introducing ts-node and additional configuration. Things that might live here:

  • One-off scripts needed for use across applications
  • Codemods

Installation & Usage

npm install @hashicorp/platform-tools

Once installed, the runner can be used to execute a packaged script, or an arbitrary script in your current working directory. Running script without any arguments will return a list of the packaged scripts:

$ npx hc-tools

Expected a script name to be passed, available scripts:
  - add-deploy-preview-script

Additional arguments beyond the script name will be passed to the executed script:

$ npx hc-tools add-deploy-preview-script waypoint

# Executes the add-deploy-preview script with the argument "waypoint"

Local scripts

hc-tools can be used to run scripts defined locally in your project, for example:

$ hc-tools ./scripts/my-script.ts

As part of this, hc-tools will also load environment variables defined in .env using the same loading strategy as Next.js.

Options

  • --project [path to tsconfig] - If specified, loads the tsconfig from the specified path
  • --resolve-paths [true|false] - Controls whether or not to resolve paths based on local tsconfig settings (default: true)

Included scripts

add-deploy-preview-script

$ hc-tools add-deploy-preview-script <product>

Adds a shell script in ./scripts/website-build.sh, which is used to build deploy previews from hashicorp/dev-portal within a product repository so contributors can continue to preview their docs changes.

next-build-webpack-only

$ hc-tools next-build-webpack-only

Executes next build and short-circuits the process before static generation occurs. Helpful for more performant builds if all we care about is the compilation output (for bundle analysis, for example).

capture-build-metrics

$ hc-tools capture-build-metrics <appName>

Captures the build metrics emitted by Next during the build process and sends them to Datadog. appName should be the name of the repo.