All Projects → pillarjs → Parseurl

pillarjs / Parseurl

Licence: mit
parse a url with memoization

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Parseurl

Parse Domain
Splits a hostname into subdomains, domain and (effective) top-level domains.
Stars: ✭ 261 (+61.11%)
Mutual labels:  parse, url
golgi
A composable routing library for Haxe.
Stars: ✭ 37 (-77.16%)
Mutual labels:  url, parse
parse-github-url
Parse a Github URL into an object. Supports a wide variety of GitHub URL formats.
Stars: ✭ 114 (-29.63%)
Mutual labels:  url, parse
Query String
Parse and stringify URL query strings
Stars: ✭ 5,781 (+3468.52%)
Mutual labels:  parse, url
Urlshorting
A simple but powerful URL shortener
Stars: ✭ 150 (-7.41%)
Mutual labels:  url
Parjs
JavaScript parser-combinator library
Stars: ✭ 145 (-10.49%)
Mutual labels:  parse
Olefile
olefile is a Python package to parse, read and write Microsoft OLE2 files (also called Structured Storage, Compound File Binary Format or Compound Document File Format), such as Microsoft Office 97-2003 documents, vbaProject.bin in MS Office 2007+ files, Image Composer and FlashPix files, Outlook messages, StickyNotes, several Microscopy file formats, McAfee antivirus quarantine files, etc.
Stars: ✭ 142 (-12.35%)
Mutual labels:  parse
Api Query Params
Convert URL query parameters to MongoDB queries
Stars: ✭ 141 (-12.96%)
Mutual labels:  url
Bm25
A Python implementation of the BM25 ranking function.
Stars: ✭ 159 (-1.85%)
Mutual labels:  parse
Purl Spec
A minimal specification for purl aka. a package "mostly universal" URL, join the discussion at https://gitter.im/package-url/Lobby
Stars: ✭ 154 (-4.94%)
Mutual labels:  url
Slang
SystemVerilog compiler and language services
Stars: ✭ 145 (-10.49%)
Mutual labels:  parse
Genieparser
sub-component of Genie that parse the device output into structured datastructure
Stars: ✭ 146 (-9.88%)
Mutual labels:  parse
Bash Parser
Parses bash into an AST
Stars: ✭ 151 (-6.79%)
Mutual labels:  parse
Pyfunceble
The tool to check the availability or syntax of domain, IP or URL.
Stars: ✭ 143 (-11.73%)
Mutual labels:  url
Ui Design Resources
UI设计资源收集
Stars: ✭ 154 (-4.94%)
Mutual labels:  url
Dirty Json
A parser for invalid JSON
Stars: ✭ 141 (-12.96%)
Mutual labels:  parse
Parse Sdk Android
The Android SDK for the Parse Platform
Stars: ✭ 1,806 (+1014.81%)
Mutual labels:  parse
Html Agility Pack
Html Agility Pack (HAP) is a free and open-source HTML parser written in C# to read/write DOM and supports plain XPATH or XSLT. It is a .NET code library that allows you to parse "out of the web" HTML files.
Stars: ✭ 2,014 (+1143.21%)
Mutual labels:  parse
Galimatias
galimatias is a URL parsing and normalization library written in Java.
Stars: ✭ 146 (-9.88%)
Mutual labels:  url
Libnmea
Lightweight C library for parsing NMEA 0183 sentences
Stars: ✭ 146 (-9.88%)
Mutual labels:  parse

parseurl

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

Parse a URL with memoization.

Install

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

$ npm install parseurl

API

var parseurl = require('parseurl')

parseurl(req)

Parse the URL of the given request object (looks at the req.url property) and return the result. The result is the same as url.parse in Node.js core. Calling this function multiple times on the same req where req.url does not change will return a cached parsed object, rather than parsing again.

parseurl.original(req)

Parse the original URL of the given request object and return the result. This works by trying to parse req.originalUrl if it is a string, otherwise parses req.url. The result is the same as url.parse in Node.js core. Calling this function multiple times on the same req where req.originalUrl does not change will return a cached parsed object, rather than parsing again.

Benchmark

$ npm run-script bench

> [email protected] bench nodejs-parseurl
> node benchmark/index.js

  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]

> node benchmark/fullurl.js

  Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy"

  4 tests completed.

  fasturl            x 2,207,842 ops/sec ±3.76% (184 runs sampled)
  nativeurl - legacy x   507,180 ops/sec ±0.82% (191 runs sampled)
  nativeurl - whatwg x   290,044 ops/sec ±1.96% (189 runs sampled)
  parseurl           x   488,907 ops/sec ±2.13% (192 runs sampled)

> node benchmark/pathquery.js

  Parsing URL "/foo/bar?user=tj&pet=fluffy"

  4 tests completed.

  fasturl            x 3,812,564 ops/sec ±3.15% (188 runs sampled)
  nativeurl - legacy x 2,651,631 ops/sec ±1.68% (189 runs sampled)
  nativeurl - whatwg x   161,837 ops/sec ±2.26% (189 runs sampled)
  parseurl           x 4,166,338 ops/sec ±2.23% (184 runs sampled)

> node benchmark/samerequest.js

  Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object

  4 tests completed.

  fasturl            x  3,821,651 ops/sec ±2.42% (185 runs sampled)
  nativeurl - legacy x  2,651,162 ops/sec ±1.90% (187 runs sampled)
  nativeurl - whatwg x    175,166 ops/sec ±1.44% (188 runs sampled)
  parseurl           x 14,912,606 ops/sec ±3.59% (183 runs sampled)

> node benchmark/simplepath.js

  Parsing URL "/foo/bar"

  4 tests completed.

  fasturl            x 12,421,765 ops/sec ±2.04% (191 runs sampled)
  nativeurl - legacy x  7,546,036 ops/sec ±1.41% (188 runs sampled)
  nativeurl - whatwg x    198,843 ops/sec ±1.83% (189 runs sampled)
  parseurl           x 24,244,006 ops/sec ±0.51% (194 runs sampled)

> node benchmark/slash.js

  Parsing URL "/"

  4 tests completed.

  fasturl            x 17,159,456 ops/sec ±3.25% (188 runs sampled)
  nativeurl - legacy x 11,635,097 ops/sec ±3.79% (184 runs sampled)
  nativeurl - whatwg x    240,693 ops/sec ±0.83% (189 runs sampled)
  parseurl           x 42,279,067 ops/sec ±0.55% (190 runs sampled)

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].