custompatch
Advanced tools
+19
-3
@@ -376,5 +376,11 @@ #!/usr/bin/env node | ||
| const oldName = path.join(curDir, 'node_modules', pathNormalize(info.index)); | ||
| if(!fs.existsSync(oldName)) fs.writeFileSync(oldName, ''); | ||
| // read the original file | ||
| fs.readFile(oldName, 'utf8', callback); | ||
| if(fs.existsSync(oldName)) | ||
| { | ||
| // read the original file | ||
| fs.readFile(oldName, 'utf8', callback); | ||
| } | ||
| else | ||
| { | ||
| callback(null, ''); // old file does not exist - i.e. it is empty | ||
| } | ||
| } | ||
@@ -444,2 +450,12 @@ | ||
| chunk.success = false; | ||
| const oldName = path.join(curDir, 'node_modules', pathNormalize(chunk.chunkInfo.index)); | ||
| if(!fs.existsSync(oldName)) | ||
| { | ||
| const folder = path.dirname(oldName); | ||
| if (!fs.existsSync(folder)) | ||
| { | ||
| echo(startColor('yellowBright') + 'WARNING: Folder ' + stopColor() + startColor('redBright') + path.dirname(pathNormalize(chunk.chunkInfo.index)) + stopColor() + startColor('yellowBright') + ' does not exist - the patch is probably for older version'); | ||
| return; | ||
| } | ||
| } | ||
| echo(startColor('yellowBright') + 'WARNING: ' + stopColor() + 'Chunk failed - ' + startColor('redBright') + ' either already applied or for different version' + stopColor()); | ||
@@ -446,0 +462,0 @@ } |
+1
-1
| { | ||
| "name": "custompatch", | ||
| "version": "1.0.26", | ||
| "version": "1.0.27", | ||
| "description": "Tool for patching buggy NPM packages instead of forking them", | ||
@@ -5,0 +5,0 @@ "author": "IVO GELOV", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
21378
3.08%434
3.83%