Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bluelovers/node-jsdom-url
a not strict JSDOM URL object
https://github.com/bluelovers/node-jsdom-url
Last synced: 3 days ago
JSON representation
a not strict JSDOM URL object
- Host: GitHub
- URL: https://github.com/bluelovers/node-jsdom-url
- Owner: bluelovers
- Created: 2018-01-21T08:48:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-12-02T04:06:32.000Z (almost 5 years ago)
- Last Synced: 2024-10-03T03:22:36.761Z (about 1 month ago)
- Language: TypeScript
- Size: 31.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jsdom-url
> a proxy JSDOM URL object
`npm install jsdom-url`
## demo
```ts
import URL from 'jsdom-url';let url = new URL('https://www.npmjs.com/package/jsdom-url');
console.log(url);
console.log(`-------------`);
console.log(Object.keys(url));
console.log(`-------------`);
console.dir(url);
console.log(`-------------`);
for (let k in url)
{
console.log(k, url[k]);
}console.log(`-------------`);
console.log(url.origin);
```### output
```
URL("https://www.npmjs.com/package/jsdom-url")
-------------
[ 'href',
'origin',
'protocol',
'username',
'password',
'host',
'hostname',
'port',
'pathname',
'search',
'hash',
'searchParams' ]
-------------
URLImplCore {
href: 'https://www.npmjs.com/package/jsdom-url',
origin: 'https://www.npmjs.com',
protocol: 'https:',
username: '',
password: '',
host: 'www.npmjs.com',
hostname: 'www.npmjs.com',
port: '',
pathname: '/package/jsdom-url',
search: '',
hash: '',
searchParams:
URLSearchParamsImpl {
_list: [],
_url: URLImplCore { _url: [Object], _query: [Circular] },
[Symbol(wrapper)]: URLSearchParams {} } }
-------------
href https://www.npmjs.com/package/jsdom-url
origin https://www.npmjs.com
protocol https:
username
password
host www.npmjs.com
hostname www.npmjs.com
port
pathname /package/jsdom-url
search
hash
searchParams URLSearchParamsImpl {
_list: [],
_url: URL("https://www.npmjs.com/package/jsdom-url"),
[Symbol(wrapper)]: URLSearchParams("") }
-------------
https://www.npmjs.com
```