# @xdanangelxoqenpm/ducimus-repellat-iste

> [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4JDQMB6MRJXQE&source=url)

Latest version **1.0.0** (published 2024-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @xdanangelxoqenpm/ducimus-repellat-iste
pnpm add @xdanangelxoqenpm/ducimus-repellat-iste
yarn add @xdanangelxoqenpm/ducimus-repellat-iste
bun add @xdanangelxoqenpm/ducimus-repellat-iste
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2024-04-25 |
| First published | 2024-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 15.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | xdanangelxoqE |
| Maintainers | thanhmai019901 |
| Keywords | scheme-validation, Microsoft, curried, callbound, find, equality, break, tape, sharedarraybuffer, deep-copy, ES2018, time, resolve, CSS, ava, parent, japanese, wait, Array.prototype.findLast, styled-components, cache, performance, drag, input, omit, array, batch, ES2019, emoji, react-testing-library, RFC-6455, Float32Array, dom-testing-library, cmd, escape, libphonenumber, trimRight, 6to5, animation, plugin, higher-order, assertion, Observables, codes, byte, exit-code, ECMAScript 6, fsevents, enumerable, preserve-symlinks, promises, tacit, visual, vest, description, Array.prototype.findLastIndex, hash, HyBi, symlink, ES3, trimEnd, weakmap, jasmine, byteLength, crypt, width, TypeBox, readable, rgb, command, qs, watchFile, stream, compare, ES2023, concatMap, three, util.inspect, zod, watcher, ArrayBuffer, get, buffer, iteration, stable, compile less, babel-core, gradients css3, class-validator, figlet, serialization, config, operating-system, inference, picomatch, progress, less, ES2021, getopt, ESnext, ajax, typescript, es7, npm, ECMAScript 2021, jsdom, mocha, log, ratelimit, generics, serialize, less mixins, io-ts, check, signal, lint, byteOffset, logger, object, Symbol, slot, less.js, colors, l10n, bluebird, typed array, validation, sanitize, json-schema-validation, length, which, stateless, korean, hookform, property, code points, move, sameValueZero, mobile, Object.entries, Uint8ClampedArray, callback, Reflect.getPrototypeOf, eslintplugin, random, _.extend, runtime, setter, ECMAScript 2020, toStringTag, tools, json, ES8, Array.prototype.includes, connect, invariant, dataview, cors, jsx, quote, karma, arraybuffer, es, asserts, fs, private data, tdd, properties, mkdirp, match, argparse, sanitization, mimetypes, point-free, auth, eslintconfig, has, find-up, positive, website, trim, preprocessor, symlinks, browserslist, start, chinese, awesomesauce, types, term, format, css less, client, rmdir, airbnb, assert, valid, column, variables in css, rm -fr, ES2022, Int32Array, look-up, eventEmitter, parse, cli, streams2, ES6, accessor, irq, query, up, Int8Array, wget, superagent, mru, fantasy-land, internal, ansi, getintrinsic, joi, datastructure, concat, middleware, getPrototypeOf, WebSocket, indicator, package.json, idle, package, immutable, dir, mime, offset, exit, bundler, Object.values, eslint-plugin, symbol, schema, nodejs, censor, xdg-open, entries, limit, private, tap, weakset, reuse, URLSearchParams, typedarrays, speed, modules, telephone, fast-clone, ECMAScript 7, configurable, polyfill, prop, Observable, bind, xss, interrupts, wordbreak, fastify, styles, patch, framework, formatting, tty, ES2020, BigInt64Array, ECMAScript 5, password, fast, robust, efficient, redux-toolkit, prefix, react animation, install, chai, require, console, intrinsic, i18n, typedarray, electron, es5, postcss, es6, yup, call-bound, worker, create, Array.prototype.contains, ECMAScript 2022, validator, api, opens, touch, dependencies, shebang, call, es2017, spring, sorted, commander, throat, color, Int16Array, function, unicode, command-line, group, web, es2015, settings, Object.is, async, isConcatSpreadable, watch, js, bootstrap less, Promise, duplex, multi-package, nope, key, 256, ES7, names, ReactiveExtensions, search, Float64Array, URL, utility, character, style, rfc4122, number, deepclone, ReactiveX, child, es2016, css variable, diff, pure, let, RegExp.prototype.flags, transpile, rm, functions, stylesheet, columns, readablestream, protobuf, whatwg, prototype, ECMAScript 2016, banner, chromium, reduce, accessibility, urls, ts, once, -0, option, spinner, windows, Set, Function.prototype.name, linux, dataView, deterministic, link, WebSockets, Symbol.toStringTag, javascript, ES, data, structuredClone, extend, traverse, ECMAScript 2017, minimal, pose, promise, executable, zero, parser, emit, ajv, variables, jest, rapid, opener, deep, forEach, env, request, Array.prototype.filter, test, optimist, environment, dayjs, transpiler, sequence, is, reducer, harmony, ramda, negative, defineProperty, trimLeft, encryption, ES2017, take, clone, ascii, Map, styleguide, callbind, immer, spawn, querystring, walk, findup, Object.getPrototypeOf, handlers, eventDispatcher, serializer, xhr, dependency manager, pnpm9, date, groupBy, Array.prototype.flatMap, ast, tslib, debugger, toArray, cjk, circular, Uint8Array, syntax, typeof, monorepo, Push, parents, extension, push, crypto, prune, fastclone, const, task, fast-deep-clone, inspect, merge, open, last, bound, authentication, app, form, throttle, performant, Uint16Array, trimStart, toolkit, Object.fromEntries, autoprefixer, xterm, call-bind, toobject, glob, arktype, iterate, argument, express, writable, expression, shared, coercible, ArrayBuffer#slice, AsyncIterator, from, matches, await, native, flat, spinners, es-abstract, loading, Object.assign, error-handling, es-shims, limited, read, redact, regexp, value, warning, sigterm, extra, core-js, set, uninstall, spec, less compiler, Object.keys, functional, lru, tostringtag, classname, guid, wordwrap, estree, write |

## Links

- npm: https://www.npmjs.com/package/@xdanangelxoqenpm/ducimus-repellat-iste
- Repository: https://github.com/xdanangelxoqenpm/ducimus-repellat-iste
- Homepage: https://github.com/xdanangelxoqenpm/ducimus-repellat-iste/#readme
- Issues: https://github.com/xdanangelxoqenpm/ducimus-repellat-iste/issues
- npm.io page: https://npm.io/package/@xdanangelxoqenpm/ducimus-repellat-iste

## Dependencies (8)

- [@xdanangelxoqenpm/ex-vitae-eum](https://npm.io/package/@xdanangelxoqenpm/ex-vitae-eum.md) ^1.0.0
- [@xdanangelxoqenpm/sunt-neque-ut](https://npm.io/package/@xdanangelxoqenpm/sunt-neque-ut.md) ^1.0.0
- [@xdanangelxoqenpm/unde-nam-dolores](https://npm.io/package/@xdanangelxoqenpm/unde-nam-dolores.md) ^1.0.0
- [@crabas0npm/quos-officiis-at-eveniet](https://npm.io/package/@crabas0npm/quos-officiis-at-eveniet.md) ^1.0.0
- [@xdanangelxoqenpm/iusto-beatae-error](https://npm.io/package/@xdanangelxoqenpm/iusto-beatae-error.md) ^1.0.0
- [@ffras4vnpm/officiis-dolorem-iure-ullam](https://npm.io/package/@ffras4vnpm/officiis-dolorem-iure-ullam.md) ^1.0.0
- [@xdanangelxoqenpm/nostrum-sapiente-minus](https://npm.io/package/@xdanangelxoqenpm/nostrum-sapiente-minus.md) ^1.0.0
- [@xdanangelxoqenpm/perspiciatis-molestias-alias](https://npm.io/package/@xdanangelxoqenpm/perspiciatis-molestias-alias.md) ^1.0.0

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2024-04-25

## README

# Extract domain name from URL

[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4JDQMB6MRJXQE&source=url)

This package provides a performant way to extract domain names from URLs without using regular expressions or array manipulations.

Learn more about [What is a URL](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL)

## Supports

-   ESM
-   Node.js
-   Browser

## Usage

### Installation

```bash
$ npm i --save @xdanangelxoqenpm/ducimus-repellat-iste
```

### Development

```
# Install bun https://bun.sh/
curl -fsSL https://bun.sh/install | bash


# tests
bun test:watch
```

### API

-   @param {Urls} urls ["https://www.google.com", "https://www.github.com"] or "https://www.google.com"
-   @param {GetDomainOptions} opts `{ tld: true }` permit to get Top Level Domain like `*.co.uk`
-   @returns {Urls | Promise<Urls>} Returns URL(s) or a promise of URL(s) if the PSL lib is being used

ESM import

```js
import extractDomain from '@xdanangelxoqenpm/ducimus-repellat-iste';
```

Examples

```js
const urls = [
    'https://www.npmjs.com/package/@xdanangelxoqenpm/ducimus-repellat-iste',
    'http://www.example.com:80/path/to/myfile.html?key1=value1&key2=value2#SomewhereInTheDocument',
    'http://user:password@example.com:80/path/to/myfile.html?key1=value1&key2=value2#SomewhereInTheDocument',
    'https://npmjs.com/package/@xdanangelxoqenpm/ducimus-repellat-iste',
    'ftp://example.org/resource.txt',
    'http://example.co.uk/',
    'this.is.my@email.com',
];

extractDomain(urls[0]); // npmjs.com

extractDomain(urls); // [ 'npmjs.com', 'example.com', 'example.com', 'npmjs.com', 'example.org', 'co.uk', 'email.com' ]
```

## TLD support

TLD support requires the optional dependency of the [`psl` library](https://www.npmjs.com/package/psl).

Examples

```bash
npm i --save-optional psl
```

```js
const url =
    'http://www.example.co.uk:80/path/to/myfile.html?key1=value1&key2=value2#SomewhereInTheDocument';

async function extract(url) {
    console.log(await extractDomain(url, { tld: true }));
    // example.co.uk
}

// Or
extractDomain(url, { tld: true }).then(console.log);
// example.co.uk
```

Please note that using the tld flag may significantly slow down the process. Benchmark (old) results:

```
# extract domain 10,000 times
  end ~14 ms (0 s + 13572914 ns)
# extract domain with tld 10,000 times
  end ~4.29 s (4 s + 288108681 ns)
```

## Tests

```bash
$ bun test
```

## Coding style

```bash
$ bun pretty
```

## Benchmark

```bash
$ bun benchmark
```

## Contribution

Contributions are appreciated.

## License

MIT-licensed. See LICENSE.

---
_Source: https://npm.io/package/@xdanangelxoqenpm/ducimus-repellat-iste · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
