Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
21b6e0b
feat(tls.createSecureContext): introduce
0hmX Aug 3, 2025
144c006
Update recipes/crypto-createCredentials/codemod.yaml
0hmX Aug 3, 2025
f65c839
Update recipes/crypto-createCredentials/package.json
0hmX Aug 3, 2025
8f7bae7
Update recipes/crypto-createCredentials/package.json
0hmX Aug 3, 2025
0b4c417
rename to crypto-create-credentials
0hmX Aug 3, 2025
e36f7be
Update recipes/crypto-create-credentials/workflow.yaml
0hmX Aug 5, 2025
6525cfd
Update recipes/crypto-create-credentials/workflow.yaml
0hmX Aug 5, 2025
a56c4bb
Update recipes/crypto-create-credentials/README.md
0hmX Aug 5, 2025
e6bf56e
sync package-lock.json
0hmX Aug 5, 2025
9ac7b8b
refactor workflow.ts
0hmX Aug 5, 2025
74d8025
fix lint codemod.yml
0hmX Aug 5, 2025
81b8480
Update recipes/crypto-create-credentials/README.md
0hmX Aug 6, 2025
7b8633f
Update recipes/crypto-create-credentials/README.md
0hmX Aug 6, 2025
55bddce
Update recipes/crypto-create-credentials/package.json
0hmX Aug 6, 2025
c08282f
added os.EOL
0hmX Aug 7, 2025
202b99f
lint fix
0hmX Aug 7, 2025
67579ea
Update recipes/crypto-create-credentials/README.md
0hmX Aug 11, 2025
f36f0ee
Update recipes/crypto-create-credentials/README.md
0hmX Aug 11, 2025
21ce469
Update recipes/crypto-create-credentials/src/workflow.ts
0hmX Aug 11, 2025
1a8b640
Update recipes/crypto-create-credentials/src/workflow.ts
0hmX Aug 12, 2025
dfeb476
Update recipes/crypto-create-credentials/src/workflow.ts
0hmX Aug 12, 2025
b3f8bef
Update recipes/crypto-create-credentials/src/workflow.ts
0hmX Aug 12, 2025
f3dde78
rename to createCredentials-to-createSecureContext
0hmX Aug 13, 2025
884a44d
updated to use destructred import
0hmX Aug 13, 2025
015cd21
stable
0hmX Aug 14, 2025
152e90f
fix
0hmX Aug 14, 2025
c0fd8e0
update to test
0hmX Aug 14, 2025
d057380
remove
0hmX Aug 14, 2025
f721b00
resize
0hmX Aug 14, 2025
adc08e3
remove line not needed
0hmX Aug 15, 2025
7dbb6b2
Update recipes/createCredentials-to-createSecureContext/src/workflow.ts
0hmX Aug 15, 2025
c3fc053
remove wasTranformed var
0hmX Aug 15, 2025
44015c1
update package-lock.json
0hmX Aug 15, 2025
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
27 changes: 27 additions & 0 deletions package-lock.json

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

35 changes: 35 additions & 0 deletions recipes/createCredentials-to-createSecureContext/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# `crypto.createCredentials` DEP0010

This recipe transforms `crypto.createCredentials` usage to use modern `node:tls` methods.

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

## Examples

**Before:**
```js
// Using the deprecated createCredentials from node:crypto
const { createCredentials } = require('node:crypto');
// OR
import { createCredentials } from 'node:crypto';

const credentials = createCredentials({
key: privateKey,
cert: certificate,
ca: [caCertificate]
});
```

**After:**
```js
// Updated to use createSecureContext from node:tls
const { createSecureContext } = require('node:tls');
// OR
import { createSecureContext } from 'node:tls';

const credentials = createSecureContext({
key: privateKey,
cert: certificate,
ca: [caCertificate]
});
```
21 changes: 21 additions & 0 deletions recipes/createCredentials-to-createSecureContext/codemod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
schema_version: "1.0"
name: "@nodejs/createCredentials-to-createSecureContext"
version: 1.0.0
description: Handle DEP0010 via transforming `crypto.createCredentials` to `tls.createSecureContext`
author: 0hmx
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/createCredentials-to-createSecureContext/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@nodejs/createCredentials-to-createSecureContext",
"version": "1.0.0",
"description": "Handle DEP0010 via transforming `crypto.createCredentials` to `tls.createSecureContext` with the appropriate options.",
"type": "module",
"scripts": {
"test": "npx codemod@next jssg test -l typescript ./src/workflow.ts ./"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nodejs/userland-migrations.git",
"directory": "recipes/crypto-create-credentials",
"bugs": "https://github.com/nodejs/userland-migrations/issues"
},
"author": "0hmx",
"license": "MIT",
"homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/crypto-create-credentials/README.md",
"devDependencies": {
"@codemod.com/jssg-types": "^1.0.3"
},
"dependencies": {
"@nodejs/codemod-utils": "*"
}
}
Loading
Loading