|
| 1 | +# @terminal-nerds/snippets-url |
| 2 | + |
| 3 | +![package version badge] |
| 4 | +[![dependencies badge]][dependencies url]\ |
| 5 | +[![install size badge]][install size url] |
| 6 | + |
| 7 | +➡️ **This package wraps all available modules with snippets related to [url]** |
| 8 | +— part of the [terminal-nerds/snippets] project. |
| 9 | + |
| 10 | +[url]: https://developer.mozilla.org/en-US/docs/Web/API/URL |
| 11 | +[terminal-nerds/snippets]: https://github.com/terminal-nerds/snippets |
| 12 | +[package version badge]: https://img.shields.io/npm/v/@terminal-nerds/snippets-url/latest?style=for-the-badge&logo=npm |
| 13 | +[dependencies badge]: https://img.shields.io/librariesio/release/npm/@terminal-nerds/snippets-url?style=for-the-badge |
| 14 | +[dependencies url]: https://libraries.io/npm/@terminal-nerds%2snippets-url |
| 15 | +[install size badge]: https://packagephobia.com/badge?p=@terminal-nerds/snippets-url |
| 16 | +[install size url]: https://packagephobia.com/result?p=@terminal-nerds/snippets-url |
| 17 | + |
| 18 | +## Modules included |
| 19 | + |
| 20 | +[![documentation badge]][documentation url] |
| 21 | + |
| 22 | +[documentation badge]: https://img.shields.io/static/v1?color=informational&style=for-the-badge&label=documentation&message=jsdocs.io |
| 23 | +[documentation url]: https://jsdocs.io/package/@terminal-nerds/snippets-url |
| 24 | + |
| 25 | +<!-- prettier-sort-markdown-table --> |
| 26 | + |
| 27 | +| Name | Size | |
| 28 | +| ---- | ---- | |
| 29 | + |
| 30 | +<!-- prettier-ignore-start --> |
| 31 | +<!-- MODULES LINKS --> |
| 32 | +[`@terminal-nerds/snippets-url/localhost`]: https://github.com/terminal-nerds/snippets/blob/main/packages/url/source/localhost/localhost.ts |
| 33 | +[localhost size gzip badge]: https://badgen.net/badgesize/gzip/file-url/unpkg.com/@terminal-nerds/snippets-url/dist/localhost/localhost.js?label=gzip |
| 34 | +[localhost size brotli badge]: https://badgen.net/badgesize/brotli/file-url/unpkg.com/@terminal-nerds/snippets-url/dist/localhost/localhost.js?label=brotli |
| 35 | + |
| 36 | +[`@terminal-nerds/snippets-url/social-media`]: https://github.com/terminal-nerds/snippets/blob/main/packages/url/source/social-media/social-media.ts |
| 37 | +[social-media size gzip badge]: https://badgen.net/badgesize/gzip/file-url/unpkg.com/@terminal-nerds/snippets-url/dist/social-media/social-media.js?label=gzip |
| 38 | +[social-media size brotli badge]: https://badgen.net/badgesize/brotli/file-url/unpkg.com/@terminal-nerds/snippets-url/dist/social-media/social-media.js?label=brotli |
| 39 | + |
| 40 | +[`@terminal-nerds/snippets-url/target`]: https://github.com/terminal-nerds/snippets/blob/main/packages/url/source/target/target.ts |
| 41 | +[target size gzip badge]: https://badgen.net/badgesize/gzip/file-url/unpkg.com/@terminal-nerds/snippets-url/dist/target/target.js?label=gzip |
| 42 | +[target size brotli badge]: https://badgen.net/badgesize/brotli/file-url/unpkg.com/@terminal-nerds/snippets-url/dist/target/target.js?label=brotli |
| 43 | + |
| 44 | +[`@terminal-nerds/snippets-url/schema`]: https://github.com/terminal-nerds/snippets/blob/main/packages/url/source/schema/schema.ts |
| 45 | +[schema size gzip badge]: https://badgen.net/badgesize/gzip/file-url/unpkg.com/@terminal-nerds/snippets-url/dist/schema/schema.js?label=gzip |
| 46 | +[schema size brotli badge]: https://badgen.net/badgesize/brotli/file-url/unpkg.com/@terminal-nerds/snippets-url/dist/schema/schema.js?label=brotli |
| 47 | +<!-- prettier-ignore-end --> |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +## Prerequisites & usage |
| 52 | + |
| 53 | +### Optional |
| 54 | + |
| 55 | +[![supported typescript version badge]][typescript] |
| 56 | + |
| 57 | +[typescript]: https://typescriptlang.org/ |
| 58 | +[typescript icon]: https://api.iconify.design/logos/typescript-icon.svg |
| 59 | +[supported typescript version badge]: https://img.shields.io/github/package-json/dependency-version/terminal-nerds/snippets/peer/typescript?filename=packages%2Ftypescript%2Fpackage.json&logo=typescript&style=for-the-badge&label=typescript |
| 60 | + |
| 61 | +If you are using ![typescript icon] [TypeScript], |
| 62 | +the latest version, which supports new features _(such as `satisfies`)_, is supported. |
| 63 | + |
| 64 | +### Runtime environments |
| 65 | + |
| 66 | +This package can be used in several runtime environments. |
| 67 | +We aim for cross-runtime compatibility and ensure proper error messages |
| 68 | +if a particular snippet cannot be run in the currently running environment. |
| 69 | + |
| 70 | +#### Browsers |
| 71 | + |
| 72 | +We use [browserslist] to define the minimum browsers versions supported.\ |
| 73 | +Take a look at our [shared browserslist configuration] for more details. |
| 74 | + |
| 75 | +[browserslist]: https://github.com/browserslist/browserslist |
| 76 | +[shared browserslist configuration]: https://github.com/terminal-nerds/configs/blob/main/packages/browserslist/source/browsers.ts |
| 77 | + |
| 78 | +**Usage**: |
| 79 | + |
| 80 | +```html |
| 81 | +<script type="module"> |
| 82 | + import { snippet } from "https://cdn.jsdelivr.net/npm/@terminal-nerds/snippets-url"; |
| 83 | +</script> |
| 84 | +``` |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +#### Bun |
| 89 | + |
| 90 | +We aim to support the latest version of ![bun icon] [bun]. |
| 91 | + |
| 92 | +**Usage**: |
| 93 | + |
| 94 | +Firstly, install it: |
| 95 | + |
| 96 | +```sh |
| 97 | +bun add @terminal-nerds/snippets-url |
| 98 | +``` |
| 99 | + |
| 100 | +And then in a particular file: |
| 101 | + |
| 102 | +```js |
| 103 | +import { snippet } from "@terminal-nerds/snippets-url"; |
| 104 | +``` |
| 105 | + |
| 106 | +[bun]: https://bun.sh/ |
| 107 | +[bun icon]: https://api.iconify.design/logos/bun.svg |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +#### Deno |
| 112 | + |
| 113 | +We aim to support the latest version of ![deno icon] [Deno]. |
| 114 | + |
| 115 | +**Usage**: |
| 116 | + |
| 117 | +```ts |
| 118 | +import { snippet } from "npm:@terminal-nerds/snippets-url"; |
| 119 | +``` |
| 120 | + |
| 121 | +[deno]: https://deno.land/ |
| 122 | +[deno icon]: https://api.iconify.design/logos/deno.svg |
| 123 | + |
| 124 | +--- |
| 125 | + |
| 126 | +#### Node.js |
| 127 | + |
| 128 | +[![node.js version support badge]][node.js] |
| 129 | + |
| 130 | +The latest ![node.js icon] [Node.js] LTS _(Long-Term Support)_ version is the minimum one supported. |
| 131 | + |
| 132 | +> **Warning**\ |
| 133 | +> **This package is written in [ES Module] _(ESM)_ type.**\ |
| 134 | +> So, if you wish to use it in a project with CommonJS (CJS) type, you need to bundle this package or a particular module(s). |
| 135 | +
|
| 136 | +**Usage**: |
| 137 | + |
| 138 | +Install it first with the Node.js package manager of your choice. In our example, we use [pnpm]. |
| 139 | + |
| 140 | +```sh |
| 141 | +pnpm add @terminal-nerds/snippets-url |
| 142 | +``` |
| 143 | + |
| 144 | +And then in a particular file: |
| 145 | + |
| 146 | +```js |
| 147 | +import { snippet } from "@terminal-nerds/snippets-url"; |
| 148 | +``` |
| 149 | + |
| 150 | +[ES Module]: https://www.freecodecamp.org/news/javascript-es-modules-and-module-bundlers |
| 151 | +[pnpm]: https://pnpm.io |
| 152 | +[node.js]: https://nodejs.org/en/ |
| 153 | +[node.js icon]: https://api.iconify.design/logos/nodejs-icon.svg |
| 154 | +[node.js version support badge]: https://img.shields.io/node/v-lts/@terminal-nerds/snippets?style=for-the-badge&logo=nodedotjs |
| 155 | + |
| 156 | +--- |
| 157 | + |
| 158 | +## Security |
| 159 | + |
| 160 | +[![workflow security badge]][security policy] |
| 161 | + |
| 162 | +🔐 For more information, please refer to the [Security section] at the root of |
| 163 | +the [terminal-nerds/snippets] monorepo. |
| 164 | + |
| 165 | +[workflow security badge]: https://img.shields.io/github/actions/workflow/status/terminal-nerds/snippets/maintenance.yml?label=Security&logo=github&style=for-the-badge&branch=main |
| 166 | +[security section]: https://github.com/terminal-nerds/snippets#security |
| 167 | +[security policy]: https://github.com/terminal-nerds/snippets/security/policy |
| 168 | + |
| 169 | +--- |
| 170 | + |
| 171 | +## License |
| 172 | + |
| 173 | +[![license badge]][license] |
| 174 | + |
| 175 | +⚖️ For more information, please refer to the [License section] at the root of the [terminal-nerds/snippets] monorepo. |
| 176 | + |
| 177 | +[license]: https://github.com/terminal-nerds/snippets/blob/main/LICENSE.md |
| 178 | +[license badge]: https://img.shields.io/github/license/terminal-nerds/snippets?style=for-the-badge |
| 179 | +[license section]: https://github.com/terminal-nerds/snippets#License |
| 180 | + |
| 181 | +### Contributing |
| 182 | + |
| 183 | +[![contributors badge]][contributors url] |
| 184 | + |
| 185 | +🤝 **Contributions of any kind are welcome!** |
| 186 | + |
| 187 | +Please refer to the monorepo _([terminal-nerds/snippets])_ project's [CONTRIBUTING file] for more information |
| 188 | +if you wish to get involved. |
| 189 | + |
| 190 | +[contributing file]: https://github.com/terminal-nerds/snippets/blob/main/.github/CONTRIBUTING.md |
| 191 | +[contributors badge]: https://img.shields.io/github/contributors/terminal-nerds/snippets?style=for-the-badge |
| 192 | +[contributors url]: https://github.com/terminal-nerds/snippets#contributors |
| 193 | + |
| 194 | +### Author |
| 195 | + |
| 196 | +🎉 The idea of this project was initiated by [xeho91]. However, it's the [contributors] who matter the most. |
| 197 | + |
| 198 | +[contributors]: https://github.com/terminal-nerds/snippets/blob/main/README.md#project-contributors |
| 199 | +[xeho91]: https://github.com/xeho91 |
0 commit comments