Spec compliant URL state machine for Node.js

Related tags

String url-js
Overview

URL Parser

This repository contains a work in progress state machine 100% compliant to the URL parser specification. The goal is to create a performant URL parser.

For more information about the URL parsing state machine visit here.

Installation

npm i --save url-state-machine

Usage

const URLStateMachine = require('url-state-machine')
const state = new URLStateMachine('https://www.yagiz.co/implementing-node-js-url-parser-in-webassembly-with-rust/')

console.log(state.url)

Benchmarks

Here's the current benchmarks comparing url-state-machine with the native URL implementation and whatwg-url.

Even though these benchmarks provide a good reference for url-state-machine, should not be taken in any consideration since the implementation of url-state-machine is not finished, and does not reflect the final performance of it.

╔═══════════════════╤═════════╤══════════════════╤═══════════╗
║ Slower tests      │ Samples │           Result │ Tolerance ║
╟───────────────────┼─────────┼──────────────────┼───────────╢
║ whatwg-url        │    2000 │  38352.06 op/sec │  ± 0.85 % ║
║ url-state-machine │    2500 │  74207.62 op/sec │  ± 0.89 % ║
╟───────────────────┼─────────┼──────────────────┼───────────╢
║ Fastest test      │ Samples │           Result │ Tolerance ║
╟───────────────────┼─────────┼──────────────────┼───────────╢
║ URL               │    2000 │ 465722.37 op/sec │  ± 0.99 % ║
╚═══════════════════╧═════════╧══════════════════╧═══════════╝

Testing

All tests are referenced and borrowed from web-platform-tests.

Test Files  1 failed (1)
     Tests  132 failed | 601 passed (733)
      Time  548ms (in thread 53ms, 1034.30%)

Conformance to specification

We're currently testing only the following attributes for URL

  • pathname
    • 89 failed | 644 passed (733)
  • host
    • 32 failed | 701 passed (733)
  • password
    • 2 failed | 731 passed (733)
  • protocol
    • 1 failed | 732 passed (733)
  • username
    • 733 passed (733)
  • port
    • 733 passed (733)
  • fragment
    • 733 passed (733)
  • query
    • 733 passed (733)
You might also like...

Complete Open Source Front End Candy Machine V2 Minter dAPP Built For The Frog Nation NFT Solana Project. Built With React, Candy Machine V2, Typescript

Complete Open Source Front End Candy Machine V2 Minter dAPP Built For The Frog Nation NFT Solana Project. Built With React, Candy Machine V2, Typescript

Complete Open Source Front End Candy Machine V2 Minter dAPP Built For The Frog Nation NFT Solana Project. Built With React, Candy Machine V2, Typescript

Sep 24, 2022

we try to make a tiny p2p client spec, maybe for sigchain gossip thing, maybe for simple blockchain thing

mininode Mininode is a tiny p2p client for prototyping p2p protocols. It is a specification for a set of interfaces that I made to make it easier to t

Nov 23, 2022

An implementation of the ECMA-419 spec on the Raspberry Pi

raspi-419 An implementation of the ECMA-419 spec on the Raspberry Pi Licsense MIT License Copyright (c) Bryan Hughes Permission is hereby granted, fre

Jun 9, 2022

Zemi is data-driven and reverse-routing library for Express. It provides out-of-the-box OpenAPI support, allowing you to specify and autogenerate an OpenAPI spec.

zemi zemi is a data-driven routing library for Express, built with Typescript. Features: optional, out-of-the-box support for OpenAPI reverse-routing

Jul 23, 2022

Generate a zodios (typescript http client with zod validation) from an OpenAPI spec (json/yaml)

openapi-zod-client Generates a zodios (typescript http client with zod validation) from a (json/yaml) OpenAPI spec (or just use the generated schemas/

Jan 4, 2023

GitHub Action to validate that PR titles in n8n-io/n8n match n8n's version of the Conventional Commits spec

validate-n8n-pull-request-title GitHub Action to validate that PR titles in n8n-io/n8n match n8n's version of the Conventional Commits spec. Setup Cre

Oct 7, 2022

a babel plugin that can transform generator function to state machine, which is a ported version of typescript generator transform

Babel Plugin Lite Regenerator intro This babel plugin is a ported version of TypeScript generator transform. It can transform async and generator func

Jul 8, 2022

Piccloud is a full-stack (Angular & Spring Boot) online image clipboard that lets you share images over the internet by generating a unique URL. Others can access the image via this URL.

Piccloud Piccloud is a full-stack application built with Angular & Spring Boot. It is an online image clipboard that lets you share images over the in

Dec 15, 2022

Create a performant distributed context state by synergyzing atomar context pieces and composing reusable state logic.

Synergies Create a performant distributed context state by synergyzing atomar context pieces and composing reusable state logic. synergies is a tiny (

Nov 8, 2022

A wrapper for abstract-leveldown compliant stores, for Node.js and browsers.

levelup Table of Contents Click to expand levelup Table of Contents Introduction Supported Platforms Usage API Special Notes levelup(db[, options[, ca

Jan 9, 2023

🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

downshift 🏎 Primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components. Read the docs | See

Dec 28, 2022

🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

downshift 🏎 Primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components. Read the docs | See

Jan 1, 2023

WAI-ARIA compliant React autosuggest component

WAI-ARIA compliant React autosuggest component

React Autosuggest Project Status Looking for maintainers! Unfortunately, I don't have the time to maintain this project anymore. If you are interested

Dec 25, 2022

Wrap native HTTP requests with RFC compliant cache support

cacheable-request Wrap native HTTP requests with RFC compliant cache support RFC 7234 compliant HTTP caching for native Node.js HTTP/HTTPS requests. C

Dec 20, 2022

Standards-compliant WebSocket client and server

faye-websocket This is a general-purpose WebSocket implementation extracted from the Faye project. It provides classes for easily building WebSocket s

Dec 23, 2022

This example represents SCORM-compliant question set (aka quiz)

HTML&JS SCORM 2004 Compliant Quiz This example represents SCORM-compliant question set (aka quiz) and was made with Bootstrap 5 and Vanilla JS. You ma

Dec 25, 2021

Uniswapv2-pool-funding - A "Nugget Standard for Funding" compliant smart contract to provide liquidity to UniswapV2 (clone) pools. (Quickswap in this case)

uniswap(clone)-v2-pool-funding A smart contract that makes it easy to: supply liquidity to a uniswap(clone)-v2 pool using ERC20 or the network native

May 14, 2022

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Introduction Swagger UI allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without

Dec 28, 2022

A lightweight (1Kb) JavaScript package to facilitate a11y-compliant tabbed interfaces

A11y Tabs A lightweight (1Kb) JavaScript package to facilitate a11y-compliant tabbed interfaces. Documentation ↗ Demo on Codepen ↗ Features: Support

Nov 20, 2022
Comments
  • 1.0 Release

    1.0 Release

    Hey there!

    Here is a little list of all the issues related to 1.0 release.

    • [x] Rewrite parse_ipv6 in javascript
    • [x] Rewrite parse_ipv4 in javascript
    • [x] Research on performance on domain_to_ascii
    • [x] Research on removing textencoder/textdecoder from the project
    • [x] Research tr46 and its performance impact
    • [ ] Conform to all tests (100% test coverage)
    • [x] Investigate why string/percent_decode and string/utf8_percent_encode receives non-string values
    • [ ] Use shared memory allocation for utf-8 encoding
    • [x] Try to reduce the number of Uint8Array allocations
    • [x] Replace setInput while traversing checks.
    • [x] Replace states with numbers for performance
    • [x] Avoid string comparison
    opened by anonrig 0
Javascript URL mutation library

URI.js About Understanding URIs Documentation jQuery URI Plugin Author Changelog IMPORTANT: You may not need URI.js anymore! Modern browsers provide t

Medialize 6.2k Dec 30, 2022
Lightweight URL manipulation with JavaScript

domurl 2.x (former jsurl) Lightweight URL manipulation with JavaScript for both DOM and server JavaScript. Goal To have a convenient way working with

Mykhailo Stadnyk 511 Dec 28, 2022
Belirlediğiniz Özel URL'yi her saniye dener ve alırsa belirlediğiniz kanala sizi etiketleyerek onay mesajı atar.

Novasy Url Spam Selam, bahsedilecek pek bir şey yok config.json dosyasını düzenledikten sonra kullanabilirsiniz. Bana ulaşabileceğiniz sosyal medya he

novasy 28 Dec 29, 2022
Backend para encurtar url utilizando o que aprendi no Ignite da Rocketseat.

?? URL Shortener ?? ?? Tecnologias | ?? Projeto | ?? Como executar | ?? Licença ?? Tecnologias Esse projeto foi desenvolvido com as seguintes tecnolog

Iago Beserra 4 Jan 25, 2022
Backend API Rest application for ShortLink, a URL shortening service where you enter a valid URL and get back an encoded URL

ShortLink - The Shortest URL (API) Sobre o Projeto | Como Usar | Importante! Sobre o projeto The Shortest URL é um projeto back-end de ShortLink, um s

Bruno Weber 2 Mar 22, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

Node Version Manager Table of Contents About Installing and Updating Install & Update Script Additional Notes Troubleshooting on Linux Troubleshooting

nvm.sh 63.8k Jan 9, 2023
Solana blockchain candy machine app boilerplate on top of Metaplex Candy Machine. NextJS, Tailwind, Anchor, SolanaLabs.React, dev/mainnet automation scripts.

NFT Candy Factory NOTE: This repo will prob only work on unix-based environments. The NFT Candy Factory project is designed to let users fork, customi

Kevin Faveri 261 Dec 30, 2022