A modern, modular library for building Progressive Web Apps with ease. PWAFire provides a comprehensive set of APIs and utilities to enhance your web applications with PWA capabilities. Built on top of Project Fugu, PWAFire helps bridge the gap between web and native app capabilities.
For complete documentation and examples, visit Get Started with PWAFire.
- Modern, tree-shakeable API design
- Comprehensive PWA capabilities
- Zero dependencies
- TypeScript support
- Universal browser support
- Multiple import options (ESM, CJS, CDN)
- Consistent camelCase naming convention
- Built-in feature detection
- Comprehensive documentation
- Extensive test coverage
# Using npm
npm install pwafire@latest
# Using yarn
yarn add pwafire@latest
# Using pnpm
pnpm add pwafire@latest
PWAFire supports two import patterns for optimal flexibility and tree-shaking:
-
Root Import (Recommended for multiple features):
import { copyText, webShare } from "pwafire";
-
Scoped Import (Recommended for single features):
import { copyText } from "pwafire/clipboard"; import { webShare } from "pwafire/web-share";
The scoped import pattern is recommended when you only need specific features, as it enables better tree-shaking and smaller bundle sizes.
// Using root import
import { copyText } from "pwafire";
// Using scoped import (recommended for single features)
import { copyText } from "pwafire/clipboard";
const { ok, message } = await copyText("Text to copy");
<script type="module">
// Using root import
import { copyText } from "https://unpkg.com/pwafire@latest/lib/index.mjs";
// Using scoped import
import { copyText } from "https://unpkg.com/pwafire@latest/lib/pwa/clipboard/index.mjs";
const result = await copyText("Text to copy");
</script>
import { copyText } from "pwafire/clipboard";
const handleCopy = async (text: string) => {
try {
const { ok, message } = await copyText(text);
} catch (error) {
// Handle error
}
};
await handleCopy("Hello World");
// Using root import
import { check } from "pwafire";
// Using scoped import
import { check } from "pwafire/check";
const checkFeatures = async () => {
const [isShareSupported, isClipboardSupported] = await Promise.all([check.webShare(), check.clipboard()]);
};
await checkFeatures();
All APIs are stable in:
- Chrome 80+
- Microsoft Edge
- Firefox
- Safari
Check Browser Support for detailed compatibility information.
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
We welcome contributions! Please read our Contributing Guide to get started.
# Clone the repository
git clone https://github.com/pwafire/pwafire.git
# Install dependencies
npm install
# Start development
npm run dev
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
MIT © PWAFire
For detailed documentation and examples, visit Get Started with PWAFire.
- Twitter - Follow us for updates and announcements
Found a bug? Please create an issue to help us improve!
- PWA VS Code - Progressive Web Apps Code Snippets (Including Workbox Support)