xprezzo-url-parser
v1.1.0
Published
xprezzo cached url parser
Downloads
1
Readme
xprezzo-url-parser
Xprezzo URL parser
Install
This is a Node.js module available through the
npm registry. Installation is done using the
npm install
command:
$ npm install xprezzo-url-parser
API
const parseurl = require('xprezzo-url-parser')
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.
People
Xprezzo and related projects are maintained by BCloudgen Wong.