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

capacitor-xbox

v1.1.8

Published

Capacitor for xbox and UWP, powered by UWPjs.

Readme

Capacitor Xbox

A Capacitor implementation powered by UWP.js for Xbox and Windows. This project aims to mirror Capacitor’s APIs and integrate them with native UWP features, providing a bridge to run web content on Microsoft platforms with minimal changes.


| Windows | Xbox | Mobile | |---------|------|--------| | Windows img | Xbox img | Mobile img | | capacitor-xbox | capacitor-xbox | capacitorJS |


Disclaimer

Capacitor Xbox and UWP.js are in no way affiliated with Capacitor, Ionic, or Microsoft. This is a personal project intended solely to assist developers in the creation and porting of web applications and games to Xbox/Windows platforms.


Features

  • Seamlessly mirrors Capacitor: Drop-in usage if you’re already using Capacitor on other platforms.
  • UWP.js Under the Hood: Extends UWP.js to talk to native Windows/Xbox APIs, file system, and more.
  • Multi-platform: Windows desktop and Xbox.
  • “Plug and play”: Just include the script references and call the same Capacitor methods you already use for iOS/Android in your code.
  • HTML/JS frameworks: Use your favorite SPA library or plain HTML. The integrated environment can load them straight from the WebView.

How To Use

  1. Install this package (once published to npm) with your usual command:
npm install capacitor-xbox

Then use the help function to quickly see what you can do

npx capacitor-xbox help

Common sync options:

# Rename .wasm files to .txt and update references
npx capacitor-xbox sync --patch-wasm

# Make the first <canvas> fill the screen via inline CSS
npx capacitor-xbox sync --patch-css

Here’s an example file structure showing where each piece typically goes:

my-capacitor-xbox-project/
├─ package.json
├─ capacitor.config.ts
├─ resources/                // Optional folder for images or icons
├─ uwp_js.config.json        // Generated config used by the Capacitor Xbox CLI
├─ uwp/
│  └─ <YourUWPProjectName>/
│     ├─ MainPage.xaml.cs    // Primary UWP page (acts like your "app delegate")
│     ├─ <YourUWPProjectName>.csproj
│     ├─ Assets/
│     │  └─ WP/              // Dist folder for your built web files
│     └─ ... other UWP project files ...
└─ ...
  1. Include the scripts in your web build:
import { UwpBridge, CapacitorUWP } from "capacitor-xbox";

// Example usage:
const bridge = new UwpBridge();
// Register "CapacitorUWP" plugin so it can initialize
bridge.registerPlugin(CapacitorUWP);

// Then do typical Capacitor calls:
window.Capacitor.Preferences.set({ key: 'myKey', value: 'myVal' });
  1. Check for the platform if you need environment-specific logic:
(async () => {
  const platform = await window.Capacitor.getPlatform();
  if (platform === 'xbox' || platform === 'windows') {
    // Additional or restricted logic for these platforms
  }
})();
  1. Build/Deploy using your normal web or Capacitor workflow. After building, you can integrate the generated files into the UWP host or rely on the provided scripts to “sync” or “init” the environment.

Current Status / Limitations

Experimental: The Capacitor support layer is still highly experimental, so expect bugs or missing plugins. Some rely on standard web APIs as a fallback, while a few are natively implemented (e.g., Preferences). Over time, more core and community plugins will be added or improved.

Not all file operations are fully supported on Xbox. For instance, file picking is more limited, and .wasm/.zip can fail to load due to a Microsoft Edge bug. Temporarily, rename them or load as base64.

Examples of working pieces:

•	Capacitor Core (partial)
•	Preferences (complete)
•	Some basic file operations via UWP.js
•	Coming soon: Extended FS plugin

What Can You Do on Capacitor-Xbox?

•	Use the same codebase for all platforms
•	If you don’t use Capacitor, you can still just build your HTML/JS and drop it in
•	Bring your favorite UI frameworks (React, Vue, Angular, etc.)
•	Port WebGL/Emscripten Games* or other advanced scenarios
  • Some extra workarounds may be required for WebGL on Edge WebView2, especially for file serving or .wasm file naming.

Known Limitations

•	Some plugins won’t work out of the box. They might fail or fall back to web-only logic.
•	.WASM / .ZIP might need a rename or base64 trick to bypass Edge WebView2 load bugs.
•	Filesystem is being developed. In the meantime, you can still do advanced file operations using the raw UWP.js calls.

Using and Extending the C# Backend

Inside the uwp folder, you’ll find the UWP C# project which exposes native methods to the WebView. You can install NuGet packages in Visual Studio (or your preferred IDE) and then surface their functionality by:

1.	Adding your desired code into UwpNativeMethods.
2.	Creating public Task<string> methods that do the new work you need.
3.	Calling those methods from your JS by bridge.callNative('yourNewMethodName', args...).

Any extended C# code becomes directly available to your JavaScript via the same bridging mechanism. That way you can map new capabilities (speech recognition, advanced Windows APIs, custom hardware features, etc.) into your web code with minimal overhead.

© 2025. Created by momo-AUX1 and contributed by the open-source community. For issues, discussions, or to submit contributions, please visit: https://github.com/momo-AUX1/UWP.js