Comparing version 1.0.0 to 1.0.1
27
index.js
#!/usr/bin/env node | ||
console.log(12345678) | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const { getAllFiles } = require('yu-node'); | ||
let arr = path.resolve('./').split(path.sep); | ||
let str = fs.readFileSync( path.resolve(__dirname,'./ectype/package.json'),'utf8' ); | ||
data = str.replace('test-1',arr[arr.length-1]); | ||
fs.writeFileSync('./package.json',data); | ||
let files = getAllFiles(path.resolve(__dirname,'./ectype')); | ||
files.forEach(file=>{ | ||
let arr = file.split(path.sep); | ||
let pathArr = arr.filter((key,i)=>{ | ||
return i>3 ? true : false; | ||
}); | ||
let filePath = path.join(...pathArr); | ||
let obj = path.parse(filePath); | ||
if(obj.dir && !fs.existsSync(obj.dir)){ | ||
fs.mkdirSync(obj.dir); | ||
} | ||
if(obj.base.includes('package.json')) return; | ||
let readStream = fs.createReadStream(file); | ||
let writeStream = fs.createWriteStream(path.resolve('./',filePath)); | ||
readStream.pipe(writeStream); | ||
}); |
{ | ||
"name": "yu-init", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -10,6 +10,9 @@ "main": "index.js", | ||
"bin":{ | ||
"yu":"./index.js" | ||
"yu-init":"./index.js" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
"license": "ISC", | ||
"dependencies": { | ||
"yu-node": "^1.0.8" | ||
} | ||
} |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
4176
9
61
0
1
2
+ Addedyu-node@^1.0.8
+ Addedyu-node@1.1.5(transitive)
+ Addedyu-util@1.3.1(transitive)