mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-07 08:33:50 +08:00
- node:punycode: encode, decode, toASCII, toUnicode, ucs2.decode, ucs2.encode and version, ported from the punycode.js 2.1.0 Node bundles (scr_url.c), with its RangeErrors. DEP0040 follows Node: a static ES import reports before any module evaluates and before the program can register a 'warning' listener; require() reports on the next tick, once for both spellings, not when a dependency under node_modules loads the module first, and not under process.noDeprecation. - node:constants: the frozen object Node builds from os.constants' dlopen, errno, priority and signals groups, fs.constants (node_constants.cc order and guards) and crypto.constants (scr_os.c); its bindings read it as a checked-dynamic value. These unblock tr46 (whatwg-url, node-fetch@2) and graceful-fs (fs-extra). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
575 B
JavaScript
13 lines
575 B
JavaScript
// A dependency under node_modules that requires node:punycode: Node's
|
|
// isInsideNodeModules() rule skips DEP0040 for it, so nothing reaches stderr
|
|
// or the 'warning' listeners, and the program's own later require of the
|
|
// cached module does not report either.
|
|
"use strict";
|
|
process.on("warning", (w) => console.log("listener", w.code));
|
|
const toAscii = require("puny-dep");
|
|
const punycode = require("punycode");
|
|
|
|
console.log(toAscii("mañana.com"), toAscii("example.org"));
|
|
console.log(punycode.toUnicode("xn--maana-pta.com"));
|
|
setTimeout(() => console.log("timer"), 0);
|