[ Root System Explorer ]
Location:
Root
/
opt
/
alt
/
alt-nodejs20
/
root
/
usr
/
lib
/
node_modules
/
npm
/
node_modules.bundled
/
libnpmversion
/
lib
+ Folder
+ File
Upload
Editing: write-json.js
// write the json back, preserving the line breaks and indent const { writeFile } = require('node:fs/promises') const kIndent = Symbol.for('indent') const kNewline = Symbol.for('newline') module.exports = async (path, pkg) => { const { [kIndent]: indent = 2, [kNewline]: newline = '\n', } = pkg delete pkg._id const raw = JSON.stringify(pkg, null, indent) + '\n' const data = newline === '\n' ? raw : raw.split('\n').join(newline) return writeFile(path, data) }
SAVE CHANGES
[ CANCEL ]
Name
Type
Actions
.. (Parent Directory)
📄 commit.js
FILE
Ren
[EDIT]
DEL
📄 enforce-clean.js
FILE
Ren
[EDIT]
DEL
📄 index.js
FILE
Ren
[EDIT]
DEL
📄 read-json.js
FILE
Ren
[EDIT]
DEL
📄 retrieve-tag.js
FILE
Ren
[EDIT]
DEL
📄 tag.js
FILE
Ren
[EDIT]
DEL
📄 version.js
FILE
Ren
[EDIT]
DEL
📄 write-json.js
FILE
Ren
[EDIT]
DEL