# @builder.io/partytown

> Relocate resource intensive third-party scripts off of the main thread and into a web worker.

Latest version **0.10.3** (published 2024-12-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @builder.io/partytown
pnpm add @builder.io/partytown
yarn add @builder.io/partytown
bun add @builder.io/partytown
```

Provides the command `partytown`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.10.3 |
| Published | 2024-12-20 |
| First published | 2021-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 0 |
| Unpacked size | 384.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13779 |
| Author | Builder.io Team |
| Maintainers | steve8708, samijaber, teleaziz123, mrkoreye, strd6, mhevery, adamdbradley, gustavohgs, manucorporat, shyam-builder, sanyamkamat, murtaza-haveliwala, harmeet.builder, midhunadarvin, kylefowler, builderio-bot, armela, anaghavarhade, sidmohanty11, wmertens, jackshelton, gioboa, shairez |
| Keywords | web worker, 3rd-party, third-party, analytics, webapp, performance, lighthouse, core web vitals, react |

## Links

- npm: https://www.npmjs.com/package/@builder.io/partytown
- Repository: https://github.com/BuilderIO/partytown
- Homepage: https://github.com/BuilderIO/partytown#readme
- Issues: https://github.com/BuilderIO/partytown/issues
- npm.io page: https://npm.io/package/@builder.io/partytown

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.10.3 (latest) — 2024-12-20
- 0.10.2 — 2024-04-27
- 0.10.1 — 2024-03-24
- 0.10.0 — 2024-03-02
- 0.9.2 — 2024-02-15
- 0.9.1 — 2024-01-30
- 0.9.0 — 2024-01-23
- 0.8.2 — 2024-01-09
- 0.8.1 — 2023-09-07
- 0.8.0 — 2023-04-12
- 0.7.6 — 2023-03-21
- 0.7.5 — 2023-01-20
- 0.7.4 — 2023-01-05
- 0.7.3 — 2022-12-06
- 0.7.2 — 2022-11-17
- … 66 more at https://npm.io/package/@builder.io/partytown/versions

## README

# Partytown 🎉

<img width="838" alt="Partytown github fit 2x" src="https://user-images.githubusercontent.com/452425/134568488-f36f4640-9ada-4a78-a969-2b8315cf7f47.png">

- [Introducing Partytown: Run Third-Party Scripts From a Web Worker](https://dev.to/adamdbradley/introducing-partytown-run-third-party-scripts-from-a-web-worker-2cnp)
- [How Partytown's Sync Communication Works](https://dev.to/adamdbradley/how-partytown-s-sync-communication-works-4244)
- [How we cut 99% of our JavaScript with Qwik + Partytown](https://www.builder.io/blog/how-we-cut-99-percent-js-with-qwik-and-partytown)
- [Partytown is now in Beta](https://www.builder.io/blog/partytown-is-now-in-beta)

> A fun location for your third-party scripts to hang out

Partytown is a lazy-loaded library to help relocate resource intensive scripts into a [web worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API), and off of the [main thread](https://developer.mozilla.org/en-US/docs/Glossary/Main_thread). Its goal is to help speed up sites by dedicating the main thread to your code, and offloading third-party scripts to a web worker.

> Note: Partytown is still in beta and not guaranteed to work in every scenario. Please see our [FAQ](https://partytown.builder.io/faq) and [Trade-Off](https://partytown.builder.io/trade-offs) sections for more info.

The philosophy is that the main thread should be dedicated to your code, and any scripts that are not required to be in the [critical path](https://developers.google.com/web/fundamentals/performance/critical-rendering-path) should be moved to a web worker. Main thread performance is, without question, more important than web worker thread performance.

- [Getting Started](https://partytown.builder.io/getting-started)
- [Integrations](https://partytown.builder.io/integrations)
- [Configuration](https://partytown.builder.io/configuration)
- [Releases](https://github.com/BuilderIO/partytown/releases)
- [FAQs](https://partytown.builder.io/faq)

![Without Partytown and With Partytown: Your code and third-party code compete for main thread resources](https://user-images.githubusercontent.com/452425/152393346-6f721a4f-3f66-410a-8878-a2b49e24307f.png)

## Community

- [@QwikDev](https://twitter.com/QwikDev)
- [@Builderio](https://twitter.com/builderio)
- [Local Development](https://github.com/BuilderIO/partytown/blob/main/CONTRIBUTING.md#local-development)
- [For Plugin Authors / Developers](https://github.com/BuilderIO/partytown/blob/main/CONTRIBUTING.md#plugin-authors-developers)

## Related Projects

- [Qwik](https://github.com/BuilderIO/qwik): An open-source framework designed for best possible time to interactive, by focusing on resumability of server-side-rendering of HTML, and fine-grained lazy-loading of code.
- [Mitosis](https://github.com/BuilderIO/mitosis): Write components once, run everywhere. Compiles to Vue, React, Solid, Angular, Svelte, and more.
- [Builder](https://github.com/BuilderIO/builder): Drag and drop page builder and CMS for React, Vue, Angular, and more.

<br>
<br>
<p align="center">
   <a href="https://www.builder.io/m/developers">
      <picture>
         <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/844291/230786554-eb225eeb-2f6b-4286-b8c2-535b1131744a.png">
         <img width="250" alt="Made with love by Builder.io" src="https://user-images.githubusercontent.com/844291/230786555-a58479e4-75f3-4222-a6eb-74c5af953eac.png">
       </picture>
   </a>
</p>

---
_Source: https://npm.io/package/@builder.io/partytown · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
