@putout/plugin-nodejs 4.8.0 β†’ 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +8 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -36,7 +36,11 @@ npm i putout @putout/plugin-nodejs -D
36
36
 
37
37
  ### convert-buffer-to-buffer-alloc
38
38
 
39
- According to [DEP0005](https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor). Check out in 🐊[Putout Editor](https://putout.cloudcmd.io/#/gist/5379bcdfa3d76f7b7121c9671ae48375/2fc2c7f96fc8284788c00914a9b29bfeea8b13d4).
39
+ > The `Buffer()` function and `new Buffer()` constructor are **deprecated** due to API usability issues that can lead to accidental security issues.
40
+ >
41
+ > (c) [DEP0005](https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor)
42
+
43
+ Check out in 🐊[Putout Editor](https://putout.cloudcmd.io/#/gist/5379bcdfa3d76f7b7121c9671ae48375/2fc2c7f96fc8284788c00914a9b29bfeea8b13d4).
40
44
 
41
45
  #### ❌ Example of incorrect code
42
46
 
@@ -104,7 +108,8 @@ Only for **ESM**.
104
108
  #### ❌ Example of incorrect code
105
109
 
106
110
  ```js
107
- import {readFile} from 'fs/promises';
111
+ const {join} = require('path');
112
+ const path = require('path');
108
113
 
109
114
  const file1 = join(__dirname, '../../package.json');
110
115
  const file2 = path.join(__dirname, '../../package.json');
@@ -113,8 +118,6 @@ const file2 = path.join(__dirname, '../../package.json');
113
118
  #### βœ… Example of correct code
114
119
 
115
120
  ```js
116
- import {readFile} from 'fs/promises';
117
-
118
121
  const file1 = new URL('../../package.json', import.meta.url);
119
122
  const file2 = new URL('../../package.json', import.meta.url);
120
123
  ```
@@ -134,6 +137,7 @@ const file = new URL('../../package.json', import.meta.url);
134
137
 
135
138
  ```js
136
139
  const {readFile} = require('fs/promises');
140
+ const {join} = require('path');
137
141
  const file = join(__dirname, '../../package.json');
138
142
  ```
139
143
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-nodejs",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds ability to transform code to new API of Node.js",