symlink-dir
Advanced tools
Comparing version 4.1.0 to 4.2.0
"use strict"; | ||
const betterPathResolve = require("better-path-resolve"); | ||
const fs = require("graceful-fs"); | ||
const fs_1 = require("fs"); | ||
const path = require("path"); | ||
const renameOverwrite = require("rename-overwrite"); | ||
const util_1 = require("util"); | ||
const symlink = util_1.promisify(fs.symlink); | ||
const readlink = util_1.promisify(fs.readlink); | ||
const unlink = util_1.promisify(fs.unlink); | ||
const mkdir = util_1.promisify(fs.mkdir); | ||
const IS_WINDOWS = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE); | ||
@@ -36,3 +31,3 @@ // Always use "junctions" on Windows. Even though support for "symbolic links" was added in Vista+, users by default | ||
try { | ||
await symlink(src, dest, symlinkType); | ||
await fs_1.promises.symlink(src, dest, symlinkType); | ||
return { reused: false }; | ||
@@ -44,3 +39,3 @@ } | ||
try { | ||
await mkdir(path.dirname(dest), { recursive: true }); | ||
await fs_1.promises.mkdir(path.dirname(dest), { recursive: true }); | ||
} | ||
@@ -53,3 +48,3 @@ catch (mkdirError) { | ||
} | ||
await symlink(src, dest, symlinkType); | ||
await fs_1.promises.symlink(src, dest, symlinkType); | ||
return { reused: false }; | ||
@@ -67,3 +62,3 @@ case 'EEXIST': | ||
try { | ||
linkString = await readlink(dest); | ||
linkString = await fs_1.promises.readlink(dest); | ||
} | ||
@@ -83,3 +78,3 @@ catch (err) { | ||
} | ||
await unlink(dest); | ||
await fs_1.promises.unlink(dest); | ||
return await forceSymlink(src, dest); | ||
@@ -86,0 +81,0 @@ } |
137
package.json
{ | ||
"name": "symlink-dir", | ||
"version": "4.1.0", | ||
"description": "Cross-platform directory symlinking", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist/", | ||
"!*.map" | ||
], | ||
"typings": "dist/index.d.ts", | ||
"bin": "dist/cli.js", | ||
"keywords": [ | ||
"symlink", | ||
"symlinking", | ||
"junction", | ||
"directory", | ||
"dir", | ||
"folder" | ||
], | ||
"scripts": { | ||
"pretest": "rimraf node_modules/src", | ||
"test": "ts-node test", | ||
"test-md": "mos t", | ||
"premd": "rimraf node_modules/src && npm run tsc", | ||
"md": "mos", | ||
"tsc": "rimraf dist && tsc", | ||
"prepublishOnly": "npm run tsc" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/zkochan/symlink-dir.git" | ||
}, | ||
"author": { | ||
"name": "Zoltan Kochan", | ||
"email": "z@kochan.io", | ||
"url": "https://www.kochan.io" | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/zkochan/symlink-dir/issues" | ||
}, | ||
"homepage": "https://github.com/zkochan/symlink-dir#readme", | ||
"devDependencies": { | ||
"@types/node": "^14.0.11", | ||
"@types/tape": "^4.13.0", | ||
"mos": "^1.3.1", | ||
"mos-plugin-readme": "^1.0.4", | ||
"rimraf": "^3.0.2", | ||
"tape": "^5.0.1", | ||
"tempy": "^0.5.0", | ||
"ts-node": "^8.10.2", | ||
"typescript": "^3.9.5", | ||
"write-json-file": "^4.3.0" | ||
}, | ||
"dependencies": { | ||
"better-path-resolve": "^1.0.0", | ||
"graceful-fs": "^4.1.11", | ||
"rename-overwrite": "^3.0.0" | ||
}, | ||
"mos": { | ||
"plugins": [ | ||
"readme" | ||
], | ||
"installation": { | ||
"useShortAlias": true | ||
} | ||
}, | ||
"engines": { | ||
"node": ">=10.12" | ||
} | ||
"name": "symlink-dir", | ||
"version": "4.2.0", | ||
"description": "Cross-platform directory symlinking", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist/", | ||
"!*.map" | ||
], | ||
"typings": "dist/index.d.ts", | ||
"bin": "dist/cli.js", | ||
"keywords": [ | ||
"symlink", | ||
"symlinking", | ||
"junction", | ||
"directory", | ||
"dir", | ||
"folder" | ||
], | ||
"scripts": { | ||
"pretest": "rimraf node_modules/src", | ||
"test": "ts-node test", | ||
"test-md": "mos t", | ||
"premd": "rimraf node_modules/src && npm run tsc", | ||
"md": "mos", | ||
"tsc": "rimraf dist && tsc", | ||
"prepublishOnly": "npm run tsc" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/zkochan/symlink-dir.git" | ||
}, | ||
"author": { | ||
"name": "Zoltan Kochan", | ||
"email": "z@kochan.io", | ||
"url": "https://www.kochan.io" | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/zkochan/symlink-dir/issues" | ||
}, | ||
"homepage": "https://github.com/zkochan/symlink-dir#readme", | ||
"devDependencies": { | ||
"@types/node": "^14.0.11", | ||
"@types/tape": "^4.13.0", | ||
"mos": "^1.3.1", | ||
"mos-plugin-readme": "^1.0.4", | ||
"rimraf": "^3.0.2", | ||
"tape": "^5.0.1", | ||
"tempy": "^1.0.0", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^4.0.0", | ||
"write-json-file": "^4.3.0" | ||
}, | ||
"dependencies": { | ||
"better-path-resolve": "^1.0.0", | ||
"rename-overwrite": "^3.1.0" | ||
}, | ||
"mos": { | ||
"plugins": [ | ||
"readme" | ||
], | ||
"installation": { | ||
"useShortAlias": true | ||
} | ||
}, | ||
"engines": { | ||
"node": ">=10.12" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
2
7898
92
2
- Removedgraceful-fs@^4.1.11
- Removedgraceful-fs@4.2.11(transitive)
Updatedrename-overwrite@^3.1.0