node:net
#Import
import net from "nstdlib/node/net";Note
The API is available, but not everything works. connect() works wherever the host backs the socket bridge. native/ does, and listen() is refused by name everywhere. BlockList and SocketAddress are real in every runtime: address parsing and the rule engine are pure arithmetic, so they are implemented rather than stubbed, and diffed against the host builtin.
#Support
- nstd: Net differential(s) differ from the host node.
- Browser: Loads with a minimal
processobject. 19 of Node's 19 exports are available. 1 of 1 behavior checks match Node.js.
#Exports (19)
Every name Node.js exports from this module, and what you get when you read it, as a named import or as a property of the default import:
- ✅ A value, both ways. An export that throws an error naming the missing feature also counts.
- ⚠️ A value one way,
undefinedthe other. - ❔
undefinedboth ways. - ❌ Not exported at all.
- – Not measured.
| Export | Node.js | Browser |
|---|---|---|
BlockList | ✅ | ✅ |
BoundSocket | ✅ | ✅ |
Server | ✅ | ✅ |
Socket | ✅ | ✅ |
SocketAddress | ✅ | ✅ |
Stream | ✅ | ✅ |
_TransferredBoundSocket | ✅ | ✅ |
_createServerHandle | ✅ | ✅ |
_normalizeArgs | ✅ | ✅ |
connect | ✅ | ✅ |
createConnection | ✅ | ✅ |
createServer | ✅ | ✅ |
getDefaultAutoSelectFamily | ✅ | ✅ |
getDefaultAutoSelectFamilyAttemptTimeout | ✅ | ✅ |
isIP | ✅ | ✅ |
isIPv4 | ✅ | ✅ |
isIPv6 | ✅ | ✅ |
setDefaultAutoSelectFamily | ✅ | ✅ |
setDefaultAutoSelectFamilyAttemptTimeout | ✅ | ✅ |
#Diagnostics
nstdlib running inside Node.js. This isn't an environment it's meant for, so it isn't shown above, but it tells a library problem from an environment one:
coverage: 19/19 of the host's export names answer inside host node. API only.connect()works wherever the host backs the socket bridge.native/does, andlisten()is refused by name everywhere.BlockListandSocketAddressare real in every runtime: address parsing and the rule engine are pure arithmetic, so they are implemented rather than stubbed, and diffed against the host builtin.smoke: Imports in a clean child process.node-suite: 121/161 of Node's own eligible tests pass with ./dist inside host node. A failure there and in the page is the library's, one only in the page is the engine's.