vercel-labs/portless

Replace port numbers with stable, named local URLs. For humans and agents.

TypeScript★ 11,880+73 that day#11 on trending

Analyzed September 3, 2026 at 1ad573b (main) with jscpd 5.4.0 in 0.1s.

2.24%duplicated code · 323 of 14,431 lines
28clones in code
39code files of 158 scanned
7.42%duplicated over all files · 228 clones

The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code.

Largest clones in the code

  • 27 lines in 2 placestypescript139 tokens
    335const forwardedHeaders = buildForwardedHeaders(req, reqTls);
    336const proxyReqHeaders: http.OutgoingHttpHeaders = { ...req.headers };
    337for (const [key, value] of Object.entries(forwardedHeaders)) {
    338  proxyReqHeaders[key] = value;
    339}
    340proxyReqHeaders[PORTLESS_HOPS_HEADER] = String(hops + 1);
    341// Remove HTTP/2 pseudo-headers before forwarding to HTTP/1.1 backend
    342for (const key of Object.keys(proxyReqHeaders)) {
    343  if (key.startsWith(":")) {
    344    delete proxyReqHeaders[key];
    

    First 10 of 27 lines.

  • 20 lines in 2 placestypescript116 tokens
    1754while (i < args.length && args[i].startsWith("-")) {
    1755  if (args[i] === "--") {
    1756    i++;
    1757    break;
    1758  } else if (args[i] === "--force") {
    1759    force = true;
    1760  } else if (args[i] === "--app-port") {
    1761    i++;
    1762    appPort = parseAppPort(args[i]);
    1763  } else if (applySharingFlag(args[i])) {
    

    First 10 of 20 lines.

  • 17 lines in 2 placestypescript104 tokens
    174loadRoutes(persistCleanup = false): RouteMapping[] {
    175  if (!fs.existsSync(this.routesPath)) {
    176    return [];
    177  }
    178  try {
    179    const raw = fs.readFileSync(this.routesPath, "utf-8");
    180    let parsed: unknown;
    181    try {
    182      parsed = JSON.parse(raw);
    183    } catch {
    

    First 10 of 17 lines.

7 more
Largest clones over all files, tests and data included
By format, code only
FormatFilesLinesClonesDuplicated linesDuplication
typescript2313,166273122.37%
bash141,0581111.04%
perl1174000%
javascript133000%
By format, all files
FormatFilesLinesClonesDuplicated linesDuplication
typescript7728,4792142,4678.66%
markdown61,9736683.45%
tsx222,2853361.58%
bash181,2401110.89%
json165051254.95%
css2347172.02%
yaml42781145.04%
javascript8135164.44%
perl1174000%
text138000%

Trending appearances

DayRankStarsFilesLinesClonesAll filesCodeHealthCommit
Sep 3, 2026#1111,880 (+73)15835,4972287.42%2.24%—1ad573b

Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.