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
99.8
Supply Chain
89.5
Quality
78.4
Maintenance
100
Vulnerability
100
License
v1.0.0-next.28
Published on 19 Sept 2024
v1.0.0-next.27
Published on 19 Sept 2024
v1.0.0-next.26
Published on 19 Sept 2024
v1.0.0-next.25
Published on 07 Mar 2024
v1.0.0-next.24
Published on 04 Dec 2023
v1.0.0-next.22
Published on 01 Oct 2021
JavaScript (100%)
Total Downloads
903,618,643
Last Day
1,561,159
Last Week
6,996,576
Last Month
31,082,311
Last Year
367,834,793
5,443 Stars
208 Commits
173 Forks
69 Watching
3 Branches
12 Contributors
Minified
Minified + Gzipped
Latest Version
0.5.0
Package Id
@polka/url@0.5.0
Size
1.78 kB
Publised On
18 Sept 2018
Cumulative downloads
Total Downloads
Last day
-5.7%
1,561,159
Compared to previous day
Last week
-15.9%
6,996,576
Compared to previous week
Last month
4%
31,082,311
Compared to previous month
Last year
40.2%
367,834,793
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
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
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-01-27
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