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 🙏

© 2024 – Pkg Stats / Ryan Hefner

tvkit

v0.18.0

Published

Proxy to run a modern dev server in old browsers

Downloads

1,069

Readme

TVKit

A proxy server which allows using modern dev servers in old browsers. "Run SvelteKit on a TV"

TVKit intercepts requests to a webserver and converts the responses to make them work in old browsers. This works by injecting polyfills and transpiling the modern JavaScript and CSS to code that's compatible with older browsers.

Usage (dev server)

  • Start your vite project as normal
  • Run npx tvkit@latest serve --browser "chrome 50" in another terminal
  • Open http://localhost:3000/ in an old browser to visit your website

tvkit serve

| Option | Default value | Description | | ----------- | --------------------- | --------------------------------------------------------------------------- | | [target] | http://localhost:5173 | The URL of the website that is too new | | --port | 3000 | The port the proxy server is going to run on | | --browser | | The transpilation target (uses browserslist) | | --add | | Override feature. Ex --add "es6-module" forces adding systemjs polyfill | | --remove | | Override feature: Ex --remove fetch forces omitting whatwg-fetch polyfill | | --no-css | false | Disable CSS transpilation | | --ssl-cert | | Path to the SSL certificate for https | | --ssl-key | | Path to the SSL certificate's private key | | --no-minify | false | Disable minificaton for the polyfills | | --help | | Show message per command. Ex: tvkit serve --help |

TVKit adds browser aliases for SmartTV platforms: Example --browser "Tizen 5" is aliased to Chrome 63

Start tvkit & servers at the same time

Use concurrently to start both servers at the same time:

// package.json
"scripts": {
  "dev": "concurrently --kill-others-on-fail \"npm:dev:*\"",
  "dev:vite": "vite dev",
  "dev:tvkit": "tvkit serve --browser \"Tizen 4, WebOS 4\"",

Usage (build)

Copy folder contents and transform all html, js & css files into new directory.

Build your project for modern browsers (example: vite build) and then use the tvkit build to convert the generated folder into something that is compatible for older browsers.

npx tvkit@latest build path/to/build --out path/to/output --browser "chrome 50"

tvkit build

| Option | Default value | Description | | ----------- | ------------- | --------------------------------------------------------------------------- | | [folder] | | The folder containing modern javascript | | --out | | The output folder | | --browser | | The transpilation target (uses browserslist) | | --force | false | Overwrite files in output folder | | --add | | Override feature. Ex --add "es6-module" forces adding systemjs polyfill | | --remove | | Override feature: Ex --remove fetch forces omitting whatwg-fetch polyfill | | --no-css | false | Disable CSS transpilation | | --no-minify | false | Disable minificaton | | --quiet | false | Only log errors | | --help | | Show message per command. Ex: tvkit build --help |

Note: Polyfilling will degrade the performance for platforms that could've run the modern javascript version. An alternative to tvkit build is using @vitejs/plugin-legacy which has better performance on modern browsers, but doesn't work for some project setups (like SvelteKit projects).

TVKit supports static builds from any framework and has special support for SvelteKit's node-adapter & vercel-adapter builds.

Technology

Consider funding these projects as they do a lot of the heavy lifting.