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

@lyohaplotinka/quickwebserver

v0.0.3

Published

Implementation of HTTP web server in the QuickJS Runtime

Downloads

5

Readme

QuickWebServer

Implementation of HTTP web server in the QuickJS Runtime

QuickJS (© Fabrice Bellard and Charlie Gordon) is a small and embeddable Javascript engine. It supports the ES2020 specification including modules, asynchronous generators, proxies and BigInt.

This repository is an HTTP web server implementation for QuickJS. It consists of two parts:

  1. A shared C library that adds a native module to QuickJS to start a web server and handle requests (uses httpserver.h by Jeremy Williams);
  2. JavaScript API for easy interaction with this module, inspired by Express.js

What the server can do now

  • Handle GET and POST requests;
  • Provide headers, url and request body;
  • Process static files, serve them with the correct MIME type;
  • Provides a convenient API for response: setting headers, content type, sending files.

Is the server ready for production?

Not really. Testing was carried out on macOS and Ubuntu, load tests have not been performed yet. A stable version has not yet been released.

How can I use it now?

QuickJS gives us several benefits:

  • Tiny size of the engine;
  • Relatively high speed of work (benchmarks);
  • Ability to compile your JS application into a native binary application.

Thus, you can use QuickJS and QuickWebServer to build simple microservices, APIs, or serve static sites.

Ultimately, most of the work happens outside the server's area of responsibility (for example, working with databases).

TODOs and known issues

  • [ ] No parsing for multipart/form-data body;
  • [ ] File uploading via POST multipart/form-data doesn't work yet;
  • [ ] Sending a POST request with a file larger than 1MB may cause a server crash;

You can add to this list by opening an issue in this repository.

Documentation

Please see the Docs website (made with QWS)