https://github.com/aegisjsproject/url
Safe URL parsing/escaping via JS tagged templates
https://github.com/aegisjsproject/url
aegis aegisjsproject security url url-parser
Last synced: about 1 year ago
JSON representation
Safe URL parsing/escaping via JS tagged templates
- Host: GitHub
- URL: https://github.com/aegisjsproject/url
- Owner: AegisJSProject
- License: mit
- Created: 2024-10-27T22:36:56.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-10T16:59:12.000Z (about 1 year ago)
- Last Synced: 2025-04-13T09:08:57.371Z (about 1 year ago)
- Topics: aegis, aegisjsproject, security, url, url-parser
- Language: JavaScript
- Homepage: https://npmjs.com/package/@aegisjsproject/url
- Size: 333 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# `@aegisjsproject/url`
Safe URL parsing/escaping via JS tagged templates
[](https://github.com/AegisJSProject/url/actions/workflows/codeql-analysis.yml)


[](https://github.com/AegisJSProject/url/blob/master/LICENSE)
[](https://github.com/AegisJSProject/url/commits/master)
[](https://github.com/AegisJSProject/url/releases)
[](https://github.com/sponsors/shgysk8zer0)
[](https://www.npmjs.com/package/@aegisjsproject/url)


[](https://www.npmjs.com/package/@aegisjsproject/url)
[](https://github.com/shgysk8zer0)


[](https://twitter.com/shgysk8zer0)
[](https://liberapay.com/shgysk8zer0/donate "Donate using Liberapay")
- - -
- [Code of Conduct](./.github/CODE_OF_CONDUCT.md)
- [Contributing](./.github/CONTRIBUTING.md)
## Installation
```bash
npm i @aegisjsproject/url
```
## Usage
```js
import { url } from '@aegisjsproject/url';
// Santize user input (encodes and escapes as necessary)
const url1 = url`https://example.com/${userInput}`;
const url2 = url`${location.origin}/path/${someVar}`;
// Create a `blob:` URI from a file
const file = new File(['Hello, World!'], hi.txt, { type: 'text/plain' });
const download = `Download File`;
```