Comparing version 1.0.1 to 1.0.2
18
crspr.js
@@ -5,10 +5,2 @@ /** | ||
function registerGlobal(moduleName, asName) { | ||
if (!global[asName]) { | ||
console.info('reistered global', moduleName, 'as', asName); | ||
global[asName] = require(moduleName); | ||
} | ||
} | ||
/*** A-START ***/ | ||
@@ -26,2 +18,3 @@ /*** T-END ***/ | ||
var util = require('util'); | ||
var path = require('path'); | ||
@@ -40,5 +33,10 @@ function crspr(startTag, endTag, replaceMent) { | ||
var mePath = process.argv[1]; | ||
console.log('me file:', mePath); | ||
var fs = require('fs'); | ||
var lineReader = require('readline').createInterface({ | ||
input: fs.createReadStream(__filename) | ||
input: fs.createReadStream(mePath) | ||
}); | ||
@@ -79,3 +77,3 @@ | ||
lineReader.on('close', function () { | ||
fs.writeFileSync(__filename, newFileLines.join('\n')); | ||
fs.writeFileSync(mePath, newFileLines.join('\n')); | ||
console.log('wrote file'); | ||
@@ -82,0 +80,0 @@ }); |
{ | ||
"name": "crspr", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Self modifying files toolkit", | ||
@@ -5,0 +5,0 @@ "main": "crspr.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
1
5161
60