Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@fastly/as-url
Advanced tools
![npm version](https://img.shields.io/npm/v/@fastly/as-url) ![npm downloads per month](https://img.shields.io/npm/dm/@fastly/as-url)
AssemblyScript library to implement the WHATWG URL Standard, similar to the JavaScript URL Web API.
@fastly/as-url
is available as a npm package. You can install @fastly/as-url
in your AssemblyScript project by running:
npm install --save @fastly/as-url
This package attempts to be an implementation of the JavaScript URL Web API. Thus, the JavaScript URL Web API documentation could also act as a helpful getting started guide. However, while most features are implemented, some features are still in development (e.g URLSearchParams
). Please see the reference documentation in the reference-docs
directory for the full documentation.
import { URL } from '@fastly/as-url';
// Parse a complex absolute URL
const myComplexUrlString = 'https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash';
const url = new URL(myComplexUrlString);
let protocol = url.protocol; // "https:"
let username = url.username; // "user"
let password = url.password; // "pass"
let hostname = url.hostname; // "sub.example.com"
let port = url.port; // "8080"
let host = url.host; // "sub.example.com:8080"
let origin = url.origin // "https://sub.example.com:8080"
let pathname = url.pathname; // "/p/a/t/h"
let search = url.search; // "?query=string"
let hash = url.hash; // "#hash"
let href = url.href; // "https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash"
// Parse a relative URL
const relativeUrl = new URL(
"../../p/a/t/h?query=string#hash",
"https://fastly.com/path1/path2"
);
let relativeUrlHref = relativeUrl.href; // https://fastly.com/p/a/t/h?query=string#hash
Also, feel free to look through the tests for additional examples.
The Reference API documentation can be found in the reference-docs/
directory.
The changelog can be found here.
If you happen to find any security issues, please see the Fastly Security Reporting Page, or feel free to send an email to: security@fastly.com
We plan to disclose any found security vulnerabilites per the npm security reporting guidelines. Note that communications related to security issues in Fastly-maintained OSS as described here are distinct from Fastly Security Advisories.
This library was built to be used as a dependency for @fastly/as-compute
.
This library is based on the WHATWG URL Standard and strives to match the JavaScript URL Web API that Node.js 's URL library implements.
However, the goal of this library is not to be a 1-to-1 implementation of the Node URL API. The goal of this library is to enable sharing very similar, if not identical, URL code between Fastly's Compute@Edge platform and popular JavaScript platforms like Web Browsers and Node.
FAQs
![npm version](https://img.shields.io/npm/v/@fastly/as-url) ![npm downloads per month](https://img.shields.io/npm/dm/@fastly/as-url)
The npm package @fastly/as-url receives a total of 19 weekly downloads. As such, @fastly/as-url popularity was classified as not popular.
We found that @fastly/as-url demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 45 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.