cleaner-node
Advanced tools
Comparing version 0.9.3 to 0.9.4
{ | ||
"name": "cleaner-node", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "Helpful utilities and scripts to make Node projects more legible and easier for the next developer to take over.", | ||
"main": "index.js", | ||
"scripts": { | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix src/**/*.js" | ||
"lint": "eslint ./src/**/*.js", | ||
"lint:fix": "eslint ./src/**/*.js --fix" | ||
}, | ||
@@ -43,9 +43,9 @@ "repository": { | ||
"md5-file": "^5.0.0", | ||
"moment": "^2.24.0", | ||
"moment": "^2.26.0", | ||
"semver": "^7.3.2", | ||
"uuid": "^8.0.0", | ||
"uuid": "^8.1.0", | ||
"uuid-validate": "0.0.3" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^6.8.0", | ||
"eslint": "^7.0.0", | ||
"eslint-config-airbnb": "^18.1.0", | ||
@@ -59,5 +59,5 @@ "eslint-config-airbnb-base": "^14.1.0", | ||
"eslint-plugin-react": "^7.20.0", | ||
"eslint-plugin-react-hooks": "^2.5.0", | ||
"eslint-plugin-react-hooks": "^4.0.2", | ||
"eslint-plugin-standard": "^4.0.1" | ||
} | ||
} |
@@ -42,1 +42,2 @@ # cleaner-node | ||
| 0.9.3 | 2020/05/19 | Add `strings.toSnakeCase`. | | ||
| 0.9.4 | 2020/05/20 | Add `files.copyFile` && `files.moveFile`. | |
@@ -259,2 +259,15 @@ const fs = require('fs'); | ||
const copyFile = (sourcePath, targetPath, overwrite = true) => { | ||
if (!isFile(sourcePath)) { return false; } | ||
if (!overwrite && isFile(targetPath)) { return false; } | ||
if (!createPath(path.dirname(targetPath))) { return false; } | ||
fs.copyFileSync(sourcePath, targetPath); | ||
return isFile(targetPath); | ||
} | ||
const moveFile = (sourcePath, targetPath, overwrite = true) => { | ||
if (!copyFile(sourcePath, targetPath, overwrite)) { return false; } | ||
fs.deleteFile(sourcePath); | ||
return !isFile(targetPath); | ||
} | ||
module.exports = { | ||
@@ -284,3 +297,6 @@ checksum, | ||
readLines | ||
readLines, | ||
copyFile, | ||
moveFile | ||
}; |
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
72924
1838
43
Updatedmoment@^2.26.0
Updateduuid@^8.1.0