aboutsummaryrefslogtreecommitdiff
path: root/src/js/out/modules/node/fs.promises.js
blob: dea54f0135b57cb7d0b9cbf94bde29b615335806 (plain) (blame)
1
function B(i,W={}){const S=[];if(i instanceof URL)throw new TypeError("Watch URLs are not supported yet");else if(Buffer.isBuffer(i))i=i.toString();else if(typeof i!=="string")throw new TypeError("Expected path to be a string or Buffer");let k=null;if(typeof W==="string")W={encoding:W};return A.watch(i,W||{},(q,E)=>{if(S.push({eventType:q,filename:E}),k){const z=k;k=null,z()}}),{async*[Symbol.asyncIterator](){let q=!1;while(!q){while(S.length){let E=S.shift();if(E.eventType==="close"){q=!0;break}if(E.eventType==="error")throw q=!0,E.filename;yield E}await new Promise((E)=>k=E)}}}}var A=Bun.fs(),x="::bunternal::",F={[x]:(i)=>{var W={[x]:function(S,k,q){var E;try{E=i.apply(A,q),q=void 0}catch(z){q=void 0,k(z);return}S(E)}}[x];return async function(...S){return await new Promise((k,q)=>{process.nextTick(W,k,q,S)})}}}[x],T=F(A.accessSync),C=F(A.appendFileSync),R=F(A.closeSync),D=F(A.copyFileSync),g=F(A.existsSync),G=F(A.chownSync),h=F(A.chmodSync),H=F(A.fchmodSync),j=F(A.fchownSync),I=F(A.fstatSync),w=F(A.fsyncSync),J=F(A.ftruncateSync),b=F(A.futimesSync),K=F(A.lchmodSync),u=F(A.lchownSync),L=F(A.linkSync),d=F(A.lstatSync),M=F(A.mkdirSync),c=F(A.mkdtempSync),N=F(A.openSync),v=F(A.readSync),O=F(A.writeSync),a=F(A.readdirSync),P=F(A.readFileSync),y=F(A.writeFileSync),Q=F(A.readlinkSync),l=F(A.realpathSync),U=F(A.renameSync),p=F(A.statSync),V=F(A.symlinkSync),m=F(A.truncateSync),X=F(A.unlinkSync),n=F(A.utimesSync),Y=F(A.lutimesSync),t=F(A.rmSync),Z=F(A.rmdirSync),o=(i,W,S)=>{return new Promise((k,q)=>{try{var E=A.writevSync(i,W,S)}catch(z){q(z);return}k({bytesWritten:E,buffers:W})})},_=(i,W,S)=>{return new Promise((k,q)=>{try{var E=A.readvSync(i,W,S)}catch(z){q(z);return}k({bytesRead:E,buffers:W})})},r={access:T,appendFile:C,close:R,copyFile:D,exists:g,chown:G,chmod:h,fchmod:H,fchown:j,fstat:I,fsync:w,ftruncate:J,futimes:b,lchmod:K,lchown:u,link:L,lstat:d,mkdir:M,mkdtemp:c,open:N,read:v,write:O,readdir:a,readFile:P,writeFile:y,readlink:Q,realpath:l,rename:U,stat:p,symlink:V,truncate:m,unlink:X,utimes:n,lutimes:Y,rm:t,rmdir:Z,watch:B,writev:o,readv:_,constants,[Symbol.for("CommonJS")]:0};export{o as writev,y as writeFile,O as write,B as watch,n as utimes,X as unlink,m as truncate,V as symlink,p as stat,Z as rmdir,t as rm,U as rename,l as realpath,_ as readv,Q as readlink,a as readdir,P as readFile,v as read,N as open,c as mkdtemp,M as mkdir,Y as lutimes,d as lstat,L as link,u as lchown,K as lchmod,b as futimes,J as ftruncate,w as fsync,I as fstat,j as fchown,H as fchmod,g as exists,r as default,D as copyFile,R as close,G as chown,h as chmod,C as appendFile,T as access};