Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"automation",
"codemod",
"migrations",
"node.js"
"node.js"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"node.js"
"node.js"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"node.js"
"node.js"

],
"license": "MIT",
"bugs": {
Expand Down
77 changes: 77 additions & 0 deletions recipes/net-setSimultaneousAccepts-migration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# `net._setSimultaneousAccepts()` DEP0121

This recipe provides a guide for removing `net._setSimultaneousAccepts()`.

See [DEP0121](https://nodejs.org/api/deprecations.html#DEP0121).

## Examples
Comment thread
AugustinMauroy marked this conversation as resolved.

### Remove internal API call

```diff
const net = require("node:net");

-net._setSimultaneousAccepts(false);
const server = net.createServer();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const net = require("node:net");
-net._setSimultaneousAccepts(false);
const server = net.createServer();
const net = require("node:net");
- net._setSimultaneousAccepts(false);
const server = net.createServer();

```

### Remove from server initialization

```diff
const net = require("node:net");

function createServer() {
- net._setSimultaneousAccepts(true);
return net.createServer((socket) => {
// handle connection
});
}
```

### Remove from module setup

```diff
const net = require("node:net");

-net._setSimultaneousAccepts(false);
module.exports = {
createServer: () => net.createServer()
};
```

### Remove from application startup

```diff
const net = require("node:net");

function initializeApp() {
- net._setSimultaneousAccepts(true);
const server = net.createServer();
server.listen(3000);
}
```

### ESM import cleanup

```diff
import net from "node:net";

-net._setSimultaneousAccepts(false);
const server = net.createServer();
```

### Remove from configuration

```diff
const net = require("node:net");

const config = {
- simultaneousAccepts: false,
port: 8080
};

function setupServer(config) {
- net._setSimultaneousAccepts(config.simultaneousAccepts);
return net.createServer().listen(config.port);
}
```
21 changes: 21 additions & 0 deletions recipes/net-setSimultaneousAccepts-migration/codemod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
schema_version: "1.0"
name: "@nodejs/net-setSimultaneousAccepts-migration"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "@nodejs/net-setSimultaneousAccepts-migration"
name: "@nodejs/net-setSimultaneousAccepts-deprecation"

#namingIsHard @nodejs/userland-migrations what do you think

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mm, the suggestion is more correct.

version: 1.0.0
description: "Handle DEDEP0121: Remove net._setSimultaneousAccepts()"
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codemod.yaml metadata has the same typo (DEDEP0121). Please change to DEP0121 so the recipe description is accurate and consistent with the Node.js deprecation identifier.

Suggested change
description: "Handle DEDEP0121: Remove net._setSimultaneousAccepts()"
description: "Handle DEP0121: Remove net._setSimultaneousAccepts()"

Copilot uses AI. Check for mistakes.
author: Alejandro Espa
license: MIT
workflow: workflow.yaml
category: migration

targets:
languages:
- javascript
- typescript

keywords:
- transformation
- migration

registry:
access: public
visibility: public
24 changes: 24 additions & 0 deletions recipes/net-setSimultaneousAccepts-migration/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@nodejs/net-setsimultaneousaccepts-migration",
"version": "1.0.0",
"description": "Handle DEP0121: Remove net._setSimultaneousAccepts().",
"type": "module",
"scripts": {
"test": "npx codemod jssg test -l typescript ./src/workflow.ts ./"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nodejs/userland-migrations.git",
"directory": "recipes/net-setsimultaneousaccepts-migration",
"bugs": "https://github.com/nodejs/userland-migrations/issues"
},
"author": "Alejandro Espa",
"license": "MIT",
"homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/net-setsimultaneousaccepts-migration/README.md",
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

homepage URL path has the same directory casing mismatch as repository.directory, so the generated link will 404. Update it to point at recipes/net-setSimultaneousAccepts-migration/README.md.

Suggested change
"homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/net-setsimultaneousaccepts-migration/README.md",
"homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/net-setSimultaneousAccepts-migration/README.md",

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +17
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repository.directory does not match this recipe’s actual folder path (recipes/net-setSimultaneousAccepts-migration). The current value uses a different casing (net-setsimultaneousaccepts-migration), which will produce broken links in npm/GitHub metadata.

Suggested change
"directory": "recipes/net-setsimultaneousaccepts-migration",
"bugs": "https://github.com/nodejs/userland-migrations/issues"
},
"author": "Alejandro Espa",
"license": "MIT",
"homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/net-setsimultaneousaccepts-migration/README.md",
"directory": "recipes/net-setSimultaneousAccepts-migration",
"bugs": "https://github.com/nodejs/userland-migrations/issues"
},
"author": "Alejandro Espa",
"license": "MIT",
"homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/net-setSimultaneousAccepts-migration/README.md",

Copilot uses AI. Check for mistakes.
"devDependencies": {
"@codemod.com/jssg-types": "^1.0.9"
},
"dependencies": {
"@nodejs/codemod-utils": "*"
}
}
Loading
Loading