Welcome to the AI slop.
This commit is contained in:
commit
adc01bb99c
1925 changed files with 238364 additions and 0 deletions
19
node_modules/@npmcli/fs/lib/write-file.js
generated
vendored
Normal file
19
node_modules/@npmcli/fs/lib/write-file.js
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
const fs = require('./fs.js')
|
||||
const getOptions = require('./common/get-options.js')
|
||||
const owner = require('./common/owner.js')
|
||||
|
||||
const writeFile = async (file, data, opts) => {
|
||||
const options = getOptions(opts, {
|
||||
copy: ['encoding', 'mode', 'flag', 'signal', 'owner'],
|
||||
wrap: 'encoding',
|
||||
})
|
||||
const { uid, gid } = await owner.validate(file, options.owner)
|
||||
|
||||
const result = await fs.writeFile(file, data, options)
|
||||
|
||||
await owner.update(file, uid, gid)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
module.exports = writeFile
|
||||
Loading…
Add table
Add a link
Reference in a new issue