PATH: //opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/lib/utils
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 ansi-trim.js
↓
X
📄 cache-file.js
↓
X
📄 child-path.js
↓
X
📁 completion/
X
📄 completion.sh
↓
X
📄 correct-mkdir.js
↓
X
📄 deep-sort-object.js
↓
X
📄 depr-check.js
↓
X
📄 did-you-mean.js
↓
X
📄 error-handler.js
↓
X
📄 error-message.js
↓
X
📄 escape-arg.js
↓
X
📄 escape-exec-path.js
↓
X
📄 funding.js
↓
X
📄 gently-rm.js
↓
X
📄 git.js
↓
X
📄 gunzip-maybe.js
↓
X
📄 is-registry.js
↓
X
📄 is-windows-bash.js
↓
X
📄 is-windows-shell.js
↓
X
📄 is-windows.js
↓
X
📄 lifecycle-cmd.js
↓
X
📄 lifecycle.js
↓
X
📄 link.js
↓
X
📄 locker.js
↓
X
📄 metrics-launch.js
↓
X
📄 metrics.js
↓
X
📄 module-name.js
↓
X
📄 move.js
↓
X
📄 no-progress-while-running.js
↓
X
📄 open-url.js
↓
X
📄 otplease.js
↓
X
📄 output.js
↓
X
📄 package-id.js
↓
X
📄 parse-json.js
↓
X
📄 perf.js
↓
X
📄 pick-manifest-from-registry-metadata.js
↓
X
📄 pulse-till-done.js
↓
X
📄 read-local-package.js
↓
X
📄 read-user-info.js
↓
X
📄 replace-info.js
↓
X
📄 save-stack.js
↓
X
📄 spawn.js
↓
X
📄 temp-filename.js
↓
X
📄 umask.js
↓
X
📄 unix-format-path.js
↓
X
📄 unsupported.js
↓
X
📄 usage.js
↓
X
📄 warn-deprecated.js
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: cache-file.js
// XXX use infer-owner or gentle-fs.mkdir here const npm = require('../npm.js') const path = require('path') const chownr = require('chownr') const writeFileAtomic = require('write-file-atomic') const mkdirp = require('mkdirp') const fs = require('graceful-fs') let cache = null let cacheUid = null let cacheGid = null let needChown = typeof process.getuid === 'function' const getCacheOwner = () => { let st try { st = fs.lstatSync(cache) } catch (er) { if (er.code !== 'ENOENT') { throw er } st = fs.lstatSync(path.dirname(cache)) } cacheUid = st.uid cacheGid = st.gid needChown = st.uid !== process.getuid() || st.gid !== process.getgid() } const writeOrAppend = (method, file, data) => { if (!cache) { cache = npm.config.get('cache') } // redundant if already absolute, but prevents non-absolute files // from being written as if they're part of the cache. file = path.resolve(cache, file) if (cacheUid === null && needChown) { getCacheOwner() } const dir = path.dirname(file) const firstMade = mkdirp.sync(dir) if (!needChown) { return method(file, data) } let methodThrew = true try { method(file, data) methodThrew = false } finally { // always try to leave it in the right ownership state, even on failure // let the method error fail it instead of the chownr error, though if (!methodThrew) { chownr.sync(firstMade || file, cacheUid, cacheGid) } else { try { chownr.sync(firstMade || file, cacheUid, cacheGid) } catch (_) {} } } } exports.append = (file, data) => writeOrAppend(fs.appendFileSync, file, data) exports.write = (file, data) => writeOrAppend(writeFileAtomic.sync, file, data)
SIMPAN PERUBAHAN