A micro web server so fast, it'll make you dance! A micro web server so fast, it'll make you dance! :dancers:
Installations
npm install @polka/url
Developer Guide
Typescript
No
Module System
N/A
Score
99.8
Supply Chain
89.5
Quality
78.4
Maintenance
100
Vulnerability
100
License
Releases
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
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
lukeed
Download Statistics
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
GitHub Statistics
5,443 Stars
208 Commits
173 Forks
69 Watching
3 Branches
12 Contributors
Bundle Size
443.00 B
Minified
278.00 B
Minified + Gzipped
Package Meta Information
Latest Version
0.5.0
Package Id
@polka/url@0.5.0
Size
1.78 kB
Publised On
18 Sept 2018
Total Downloads
Cumulative downloads
Total Downloads
903,618,643
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
@polka/url
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.
Install
$ npm install --save @polka/url
Usage
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
API
url(req)
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.
req
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
.
Benchmarks
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)
Support
Any issues or questions can be sent to the Polka repository.
However, please specify that your inquiry is about @polka/url
specifically.
License
MIT © Luke Edwards
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
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
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/lukeed/polka/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/lukeed/polka/ci.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:23
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:24
- Warn: downloadThenRun not pinned by hash: .github/workflows/ci.yml:33
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 npmCommand dependencies pinned
- Info: 0 out of 1 downloadThenRun dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 12 are checked with a SAST tool
Score
3.7
/10
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