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

angular-deploy-bunny

v0.1.2

Published

Angular Architect builder (ng deploy) that syncs your build output to a Bunny.net CDN Storage Zone with SHA256-based incremental diffing, then purges the Pull Zone.

Readme

angular-deploy-bunny

CI npm license

An Angular Architect builder that deploys your build output to a Bunny.net CDN Storage Zone with SHA256-based incremental sync, then purges the matching Pull Zone. Wire it up as your project's ng deploy target.

  • Incremental — hashes every file with streaming SHA256 and only uploads what changed; orphaned remote files are deleted.
  • Safe ordering — uploads first, deletes second. If an upload fails it aborts before deleting anything, so the live site stays consistent. Re-running converges.
  • Cache purge — calls the Pull Zone purge API after a successful sync. A failed purge is a warning, not an error (the cache expires by TTL).
  • No secrets in config — credentials come from environment variables or a gitignored .env.local.

Install

pnpm add -D angular-deploy-bunny
# or: npm i -D angular-deploy-bunny

Requires Angular 17+ using the esbuild-based application builder — the default since v17, which emits the browser bundle into a browser/ folder — and Node 22+. The test suite runs in CI against Angular 17 through 21.

Quick start

Add a deploy target to the project in your angular.json:

"deploy": {
  "builder": "angular-deploy-bunny:deploy",
  "options": {
    "buildTarget": "my-app:build:production",
    "storageZoneName": "my-zone",
    "storageRegion": "Falkenstein",
    "pullZoneId": 12345,
    "ignore": ["**/*.map"]
  }
}

Then deploy:

ng deploy                       # build + sync + purge
ng deploy --dry-run             # preview the diff, no network writes
ng deploy --no-purge-after-upload

With buildTarget set, the builder runs the Angular build first and syncs its /browser output folder automatically. If you'd rather sync a folder you already built, drop buildTarget and set outputPath instead.

Credentials

The builder never stores secrets in angular.json. It reads two environment variables, falling back to a .env.local file at your workspace root:

cp node_modules/angular-deploy-bunny/.env.local.example .env.local
BUNNY_STORAGE_PASSWORD=…   # Storage Zones → <zone> → FTP & API Access → Password
BUNNY_ACCOUNT_API_KEY=…    # Account → API → API Key (only needed for purge)

Add .env.local to your .gitignore. The BUNNY_ACCOUNT_API_KEY is only required when purgeAfterUpload is true (the default); if either secret is missing the build aborts before touching the network with a clear message.

Options

| Option | Type | Default | Notes | | ------------------ | ---------------- | -------------- | --------------------------------------------------------------------------------------------- | | storageZoneName | string | required | Name of the Bunny Storage Zone. | | buildTarget | string \| null | null | Angular build target to run first, e.g. my-app:build:production. If null, set outputPath. | | outputPath | string \| null | null | Folder to sync. Defaults to the build target's output + /browser. | | storageRegion | enum | Falkenstein | One of: Falkenstein, London, NewYork, LosAngeles, Singapore, Stockholm, SaoPaulo, Johannesburg, Sydney. | | targetFolder | string | / | Subpath inside the storage zone. | | pullZoneId | number \| null | null | Required when purgeAfterUpload is true. | | purgeAfterUpload | boolean | true | Purge the Pull Zone cache after a successful sync. | | concurrency | number | 8 | Parallel uploads/deletes. | | retries | number | 3 | Retries per failed upload/delete/list/purge (exponential backoff). 0 disables. | | ignore | string[] | [] | Glob patterns to skip. Supports **, *, and literals. | | dryRun | boolean | false | Compute and print the diff without writing anything. |

How it works

  1. Walks the output folder computing a streaming SHA256 per file.
  2. Lists the Storage Zone recursively. The Bunny SDK returns SHA256 checksums in the listing, so no files are downloaded.
  3. Diffs local vs remote by hash into toUpload, toDelete, unchanged.
  4. Uploads changed files (with the correct Content-Type per extension, since Bunny Storage does not infer it), then deletes orphaned remote files.
  5. Purges the Pull Zone via the public purge API.

If an upload fails, the run aborts before any delete or purge. If the purge fails, the run still succeeds with a warning — the files are uploaded and the cache expires by TTL.

Develop

pnpm install
pnpm test          # vitest
pnpm run typecheck
pnpm run build     # emits dist/

Tests cover env loading, file walking, diffing, the concurrency pool, the Bunny client, and the deploy orchestrator. The orchestrator uses a small dependency injection seam so tests bypass the SDK and the real filesystem; there are no E2E tests against live Bunny — verify those with ng deploy --dry-run.

Contributing

Contributions are welcome — see CONTRIBUTING.md for the development setup, project layout, and release process.

License

MIT © Lostium