apps-script-utils 2.1.1 Help

net

net covers paths, URLs, and the pieces around them. Like lang, it does not depend on the Apps Script runtime.

Packages

Package

Covers

net/path

path joining, normalisation, parsing, and classification

net/url

URL validation

net/emitter

reserved; not implemented yet

Request authentication lives in appsscript/net rather than here, because it is bound to the Apps Script request object — see appsscript.

Paths

import { join, normalize, parse, isAbsolute, isRelative } from "apps-script-utils"; join("/a", "b", "../c"); // "/a/c" normalize("/a/b/../c"); // "/a/c" parse("/a/b/file.txt"); // { root: "/", dir: "/a/b", base: "file.txt", name: "file", ext: ".txt" } isAbsolute("/a/b"); // true isRelative("a/b"); // true

These mirror the shape of Node's path module, which makes them useful for building Drive folder paths and for any code that has to assemble a location out of parts without a real filesystem underneath.

Domains and URLs

import { isValidDomain, isUrl } from "apps-script-utils"; isValidDomain("example.com"); // true isValidDomain("not a domain"); // false isUrl("https://example.com/path"); // true isUrl("ftp://ftp.example.org/file.txt"); // true isUrl("invalid-url"); // false isUrl(" https://example.com "); // false — surrounding whitespace is not trimmed

isUrl accepts the http, https, and ftp schemes and requires a non-empty authority, so it rejects a bare scheme such as "https://". It does not accept mailto: or a protocol-relative //example.com.

Full list

path module lists the path functions. isUrl is listed with the runtime-independent functions in Base utilities.

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.