Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rename-overwrite

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rename-overwrite - npm Package Compare versions

Comparing version 2.0.2 to 3.0.0

CHANGELOG.md

10

index.js
'use strict'
const fs = require('graceful-fs')
const path = require('path')
const promisify = require('util').promisify

@@ -8,2 +9,3 @@ const rimraf = promisify(require('rimraf'))

const rename = promisify(fs.rename)
const mkdir = promisify(fs.mkdir)

@@ -26,2 +28,6 @@ module.exports = async function renameOverwrite (oldPath, newPath) {

break
case 'ENOENT':
await mkdir(path.dirname(newPath), { recursive: true })
await rename(oldPath, newPath)
break
default:

@@ -44,2 +50,6 @@ throw err

return
case 'ENOENT':
fs.mkdirSync(path.dirname(newPath), { recursive: true })
renameOverwriteSync(oldPath, newPath)
return
default:

@@ -46,0 +56,0 @@ throw err

23

package.json
{
"name": "rename-overwrite",
"version": "2.0.2",
"version": "3.0.0",
"description": "Like `fs.rename` but overwrites existing file or directory",
"main": "index.js",
"files": [
"index.js"
"index.js",
"index.d.ts"
],
"engines": {
"node": ">=8"
"node": ">=10.12"
},

@@ -29,13 +30,13 @@ "scripts": {

"dependencies": {
"graceful-fs": "^4.1.11",
"rimraf": "^3.0.0"
"graceful-fs": "^4.2.3",
"rimraf": "^3.0.2"
},
"devDependencies": {
"load-json-file": "6.1.0",
"package-preview": "2.0.0",
"standard": "13.1.0",
"tape": "^4.7.0",
"tempy": "^0.3.0",
"write-json-file": "4.1.0"
"load-json-file": "6.2.0",
"package-preview": "3.0.0",
"standard": "14.3.3",
"tape": "^5.0.0",
"tempy": "^0.5.0",
"write-json-file": "4.2.1"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc