S Offline screenshot

S Offline

Author Avatar Theme by Vinayakkulkarni
Updated: 12 May 2025
70 Stars

Simple Svelte component to detect offline & online changes.

Categories

Overview:

s-offline is a tool designed to detect offline and online events for Svelte apps. It is inspired by v-offline and built from scratch using TypeScript. This tool allows developers to ping any URL to double check if they are online or not. It emits boolean values for detected offline or online conditions.

Features:

  • Continuous Integration: s-offline can be integrated into continuous integration pipelines for automated testing and trigger GitHub releases based on the latest semantic version.
  • npm Compatibility: s-offline is compatible with npm and provides information on the npm bundle size for each version, type definitions, DeepScan grade, and Snyk vulnerabilities for the GitHub repo.
  • Integration with Other Tools: s-offline can be integrated with various tools such as LGTM Alerts, LGTM Grade, and GitHub contributors for enhanced functionality.
  • Built With Modern Technologies: s-offline is built with TypeScript and Svelte 3, making it highly efficient and performant.
  • Contributing: The tool encourages contributions from the community and provides guidelines for forking the repository, creating feature branches, committing changes, and creating pull requests.
  • Open Source License: s-offline is released under the MIT License, promoting open source development and collaboration.

Installation:

To install s-offline for your Svelte app, you can follow these steps:

  1. Install via CDN:

    <script src="https://unpkg.com/s-offline/dist/index.js"></script>
    

    or

    <script src="https://cdn.jsdelivr.net/npm/s-offline/dist/index.js"></script>
    
  2. Install via npm:

    npm install s-offline
    
  3. Import and use in your Svelte component:

    import SOffline from 's-offline';
    

Summary:

s-offline is a powerful tool that allows developers to detect offline and online events in Svelte apps. With features like continuous integration, npm compatibility, integration with other tools, and built-in support for modern technologies, s-offline simplifies the process of handling offline scenarios. The tool is open source and encourages community contributions, providing developers with an efficient and reliable solution for managing offline events in their Svelte apps.