Gathering detailed insights and metrics for @polka/url
Gathering detailed insights and metrics for @polka/url
Gathering detailed insights and metrics for @polka/url
Gathering detailed insights and metrics for @polka/url
A micro web server so fast, it'll make you dance! A micro web server so fast, it'll make you dance! :dancers:
npm install @polka/url
Typescript
Module System
v1.0.0-next.28
Updated on Sep 19, 2024
v1.0.0-next.27
Updated on Sep 19, 2024
v1.0.0-next.26
Updated on Sep 19, 2024
v1.0.0-next.25
Updated on Mar 07, 2024
v1.0.0-next.24
Updated on Dec 04, 2023
v1.0.0-next.22
Updated on Oct 01, 2021
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
5,487 Stars
208 Commits
172 Forks
69 Watchers
3 Branches
12 Contributors
Updated on Jul 15, 2025
Latest Version
0.5.0
Package Id
@polka/url@0.5.0
Size
1.78 kB
Published on
Sep 18, 2018
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
No dependencies detected.
Super fast, memoized
req.url
parser; not limited to Polka!
Parses the url
from a IncomingMessage
request. The returned object will always only contain the following keys: search
, query
, pathname
, path
, href
, and _raw
.
Note: This library does not process
protocol
,hostname
,port
, etc.
This is because the incomingreq.url
value only begins with the path information.
Parsed requests will be mutated with a _parsedUrl
key, containing the returned output. This is used for future memoization, so as to avoid parsing the same url
value multiple times.
$ npm install --save @polka/url
1const parse = require('@polka/url'); 2 3let req = { url: '/foo/bar?fizz=buzz' }; 4let foo = parse(req); 5//=> { search: '?fizz=buzz', 6//=> query: 'fizz=buzz', 7//=> pathname: '/foo/bar', 8//=> path: '/foo/bar?fizz=buzz', 9//=> href: '/foo/bar?fizz=buzz', 10//=> _raw: '/foo/bar?fizz=buzz' } 11 12// Attaches result for future memoization 13assert.deepEqual(foo, req._parsedUrl); //=> true
Returns: Object
or undefined
Important: The
req
must have aurl
key, otherwiseundefined
will be returned.
If no input is provided at all, aTypeError
will be thrown.
Type: IncomingMessage
or Object
The incoming HTTP request (req
) or a plain Object
with a url
key.
Note: In Node.js servers, the
req.url
begins with a pathname & does not include ahash
.
Running the
parseurl
benchmark suite on Node 10.9.0
Parsing: "/foo/bar?user=tj&pet=fluffy"
nativeurl x 3,496,593 ops/sec ±0.78% (194 runs sampled)
parseurl x 5,702,515 ops/sec ±0.59% (194 runs sampled)
@polka/url x 11,510,281 ops/sec ±1.93% (192 runs sampled)
REPEAT: "/foo/bar?user=tj&pet=fluffy"
nativeurl x 3,344,884 ops/sec ±0.13% (191 runs sampled)
parseurl x 20,386,848 ops/sec ±0.22% (192 runs sampled)
@polka/url x 21,088,923 ops/sec ±0.58% (191 runs sampled)
Parsing: "/foo/bar"
nativeurl x 9,808,119 ops/sec ±0.51% (190 runs sampled)
parseurl x 26,186,627 ops/sec ±0.16% (195 runs sampled)
@polka/url x 43,946,765 ops/sec ±0.55% (194 runs sampled)
Parsing: "/"
nativeurl x 15,698,746 ops/sec ±0.79% (192 runs sampled)
parseurl x 36,861,339 ops/sec ±0.19% (195 runs sampled)
@polka/url x 48,295,119 ops/sec ±0.51% (194 runs sampled)
Any issues or questions can be sent to the Polka repository.
However, please specify that your inquiry is about @polka/url
specifically.
MIT © Luke Edwards
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 9/27 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More