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

@hubspot/npm-scripts

v0.3.3

Published

Scripts for working with npm packages in the HubSpot ecosystem

Downloads

1,380

Readme

@hubspot/npm-scripts

npm version npm downloads npm license node version

A collection of scripts for internal HubSpot npm package development and management.

Tools

Package Linking Tool (hubspot-linking)

The linking tool helps manage symlinked HubSpot packages in your development environment. It provides an interactive way to link and unlink local copies of @hubspot packages.

Usage

It can be used via npx

npx @hubspot/npm-scripts hubspot-linking

Or installed as a part of the project and used in the package.json

{
  "dependencies": {
    "@hubspot/npm-scripts": "latest"
  },
  "scripts": {
    "local-link": "hubspot-linking"
  }
}

Prerequisites

  • Run yarn link from inside the local copy of any HubSpot package you want to make available for linking
  • The tool looks for packages in ~/.config/yarn/link/@hubspot/

What it does

  1. Scans your project's node_modules/@hubspot directory for currently linked packages
  2. Lists all available packages that can be linked (from your yarn link directory)
  3. Presents a checkbox interface to select which packages to link/unlink
  4. Automatically handles linking selected packages and unlinking deselected ones
  5. Runs yarn install --force to ensure dependencies are properly resolved

Release Script Builder (buildReleaseScript)

A utility function that creates a comprehensive npm release script with support for different release tags and semantic versioning.

Usage

Create a release script file (e.g., scripts/release.ts):

import { buildReleaseScript } from '@hubspot/npm-scripts';
import path from 'path';

buildReleaseScript({
  packageJsonLocation: path.resolve('./package.json'),
  buildHandlerOptions: {
    repositoryUrl: 'https://github.com/your-org/your-repo',
    mainBranch: 'main', // optional, defaults to 'master'
    build: async () => {
      // Optional custom build function
      // If not provided, runs 'yarn build'
    },
    postLatestRelease: async () => {
      // Optional function to run after latest releases
    },
  },
});

Then add to your package.json:

{
  "scripts": {
    "release": "tsx ./scripts/release.ts release"
  },
  "publishConfig": {
    "registry": "https://registry.npmjs.org/"
  }
}

Release Commands

# Release a patch version to latest
yarn release -v=patch -t=latest

# Release a minor version to next (beta)
yarn release -v=minor -t=next

# Release an experimental version
yarn release -v=patch -t=experimental

# Dry run (test without publishing)
yarn release -v=patch -t=latest -d

Parameters

  • -v, --versionIncrement: SemVer increment type (patch, minor, major, prerelease)
  • -t, --tag: Release tag (latest, next, experimental)
  • -d, --dryRun: Run without actually publishing

Features

  • Branch protection: Ensures releases are made from the correct branch
  • Version validation: Checks local version against published versions
  • Interactive prompts: Confirms release details and requires 2FA codes
  • Automatic tagging: Creates git tags and pushes to repository
  • GitHub integration: Opens PR and release pages automatically
  • Rollback support: Cleans up on failure

Repo Sync Script Builder (buildRepoSyncScript)

A utility function that creates a script to sync changes from an internal repository to a target repository (e.g., syncing internal packages to public GitHub).

Usage

Create a repo sync script file (e.g., scripts/repo-sync.ts):

import { buildRepoSyncScript } from '@hubspot/npm-scripts';

buildRepoSyncScript({
  buildHandlerOptions: {
    targetRepositoryOrg: 'https://github.com/your-org',
    targetRepositoryName: 'public-repo',
    buildCommitMessage: version =>
      `Sync changes from internal repo for version ${version}`,
    mainBranch: 'main', // optional, defaults to 'master'
    excludePatterns: [
      // optional, custom patterns to exclude from sync
      'internal-only-file.ts',
      'tests',
      'tests/**',
    ],
  },
});

NOTE: The sync script will always ignore the hs-temp-repo-sync and .git directories

Then add to your package.json:

{
  "scripts": {
    "repo-sync": "tsx ./scripts/repo-sync.ts repo-sync"
  }
}

Repo Sync Commands

# Sync changes to target repository
yarn repo-sync -v=1.0.0 --ssh-key=~/.ssh/id_rsa

# Dry run (test without pushing)
yarn repo-sync -v=1.0.0 -d

Parameters

  • -v, --version: Version to label the sync branch (required)
  • -d, --dryRun: Run without pushing changes
  • --ssh-key: Path to SSH key for target repository operations

Features

  • Branch protection: Ensures sync happens from the correct branch
  • Automatic branching: Creates a sync branch in the target repository
  • GitHub integration: Opens PR page automatically after push
  • Cleanup support: Removes temporary directories after completion

This script supports a PUBLIC_README.md pattern that allows you to maintain an internal readme file that does not sync to the target repo. The PUBLIC_README.md file will sync into the target repo as README.md.