You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constAggregionBundle=require('agg-bundle');// Create an instanceletbundle=newAggregionBundle({path: '/path/to/bundle'});// Get list of filesbundle.getFiles().then((fileNames)=>{console.log(fileNames);});// Get bundle infobundle.getBundleInfoData().then((data)=>{console.log('info',data);});// Get bundle propertiesbundle.getBundlePropertiesData().then((data)=>{console.log('properties',data);});// Set bundle infobundle.setBundleInfoData('some info string').then(()=>{returnbundle.setBundleInfoData(newBuffer('or you can use buffer'));}).then(()=>{console.log('done');});// Set bundle propertiesbundle.setBundlePropertiesData('some info string').then(()=>{returnbundle.setBundlePropertiesData(newBuffer('or you can use buffer'));}).then(()=>{console.log('done');});// Create new filebundle.createFile('path/to/file/to/create.dat').then((fd)=>{console.log(`created file with descriptor: ${fd}`);});// Open existing filebundle.openFile('path/to/existing/file.dat').then((fd)=>{console.log(`opened file with descriptor: ${fd}`);});// Read filebundle.readFileBlock(bundle.openFile('path/to/existing/file.dat'),1024*1024).then((data)=>{console.log(`Read block with size: ${data.length}`);});// Read file propertiesbundle.readFilePropertiesData(bundle.openFile('path/to/existing/file.dat')).then((propsData)=>{console.log(propsData);});// Seekletfd=bundle.openFile('path/to/existing/file.dat');bundle.seekFile(fd,1000// Position from begin);// Write filebundle.createFile('path/to/file/to/create.dat').then((fd)=>{returnbundle.writeFileBlock(fd,newBuffer(1000))}).then(()=>{console.log('Block written');});// Write file propertiesbundle.writeFilePropertiesData(bundle.openFile('path/to/existing/file.dat'),'some props').then(()=>{console.log('Properties written');});// Get file sizeconsole.log(`Size of file: ${bundle.getFileSize('path/to/existing/file.dat')}`);// Delete filebundle.deleteFile('path/to/existing/file.dat');