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

@hyperse/hps-plugin-deploy

v0.1.1

Published

A flexible deployment plugin for the HPS (Hyperse) build system that supports deploying static assets to various cloud providers.

Readme

HPS Deploy Plugin

A flexible deployment plugin for the HPS (Hyperse) build system that supports deploying static assets to various cloud providers.

Features

  • Multi-Provider Support: Deploy to different cloud storage providers
  • Flexible File Matching: Use glob patterns to specify which files to deploy
  • Progress Tracking: Real-time upload progress with spinners
  • Error Handling: Comprehensive error handling and validation
  • Extensible: Easy to add new deployment strategies

Currently Supported Providers

  • Aliyun OSS: Alibaba Cloud Object Storage Service

Installation

# yarn
yarn add @hyperse/hps-plugin-deploy
# npm
npm install @hyperse/hps-plugin-deploy
# pnpm
pnpm add @hyperse/hps-plugin-deploy

Quick Start

import { createDeployPlugin } from '@hyperse/hps-plugin-deploy';

const deployPlugin = createDeployPlugin();

// Register with your HPS wizard
wizard.use(deployPlugin);

Usage

Basic Deployment

# Deploy all files in dist/ to Aliyun OSS
hps deploy --target aliyun --match "dist/**/*"

# Deploy with custom prefix
hps deploy --target aliyun --match "dist/**/*" --prefix "v1.0.0"

# Deploy specific file types
hps deploy --target aliyun --match "dist/**/*.js" "dist/**/*.css"

Command Options

| Option | Alias | Description | Default | | --------------- | ----- | ------------------------------ | ----------------- | | --target | -t | Deployment target (required) | - | | --project-cwd | -p | Project working directory | Current directory | | --prefix | - | Path prefix for uploaded files | Empty string | | --match | -m | File patterns to match | Empty array | | --ignore | -i | File patterns to ignore | Empty array |

Configuration

Environment Variables

For Aliyun OSS deployment, set the following environment variables:

# Required for Aliyun OSS
export REMOTE_CDN_BASE_URL="https://your-cdn.example.com"
export ALIYUN_API_ENDPOINT="https://oss-cn-hangzhou.aliyuncs.com"
export ALIYUN_ACCESS_KEY_ID="your-access-key-id"
export ALIYUN_ACCESS_KEY_SECRET="your-access-key-secret"
export ALIYUN_BUCKET_NAME="your-bucket-name"

Custom Deployment Strategies

You can create custom deployment strategies by implementing the AssetDeployStrategy interface:

import {
  AssetDeployStrategy,
  AssetDeployStrategyOptions,
} from '@hyperse/hps-plugin-deploy';

class MyCustomStrategy implements AssetDeployStrategy {
  readonly name = 'my-custom-target';

  async deploy(
    filePaths: string[],
    options: AssetDeployStrategyOptions
  ): Promise<void> {
    for (const filePath of filePaths) {
      // Implement your deployment logic here
      await this.uploadToMyService(filePath, options);
    }
  }

  private async uploadToMyService(
    filePath: string,
    options: AssetDeployStrategyOptions
  ) {
    // Your upload implementation
  }
}

// Use your custom strategy
const deployPlugin = createDeployPlugin({
  deployStrategies: [new MyCustomStrategy()],
});

API Reference

createDeployPlugin(options?)

Creates a deploy plugin instance.

Parameters:

  • options (optional): Configuration options
    • deployStrategies: Array of custom deployment strategies

Returns: A configured deploy plugin

AssetDeployStrategy

Interface that all deployment strategies must implement.

Properties:

  • name: Unique strategy identifier
  • deploy(): Method to deploy files

Utility Functions

ensureSlash(str, slashEndfix?, multiPlatform?)

Normalizes path strings with proper slash endings.

prepareUploadFiles(options)

Prepares files for upload by matching patterns and filtering ignored files.

isRemoteFileExist(httpFilePath, options?)

Checks if a file exists on a remote server.

File Patterns

The plugin uses glob patterns for file matching and ignoring:

  • dist/**/* - All files in dist directory and subdirectories
  • *.js - All JavaScript files
  • !**/*.map - Ignore all .map files
  • **/node_modules/** - Ignore node_modules (automatically included)

Error Handling

The plugin provides comprehensive error handling:

  • Configuration Validation: Validates required environment variables
  • File Validation: Ensures files exist before attempting upload
  • Network Errors: Handles network timeouts and connection issues
  • Upload Failures: Provides detailed error messages for failed uploads

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Implement your changes
  4. Add tests
  5. Submit a pull request

License

This project is licensed under the GPLv3 LICENSE.