import fs from 'node:fs'; import path from 'node:path'; import {createHash} from 'node:crypto'; const root=process.cwd(),dataDir=path.join(root,'public','data'); const index=JSON.parse(fs.readFileSync(path.join(dataDir,'api-manifest.json'),'utf8')); const raw=JSON.parse(fs.readFileSync(path.join(root,'public',index['/api/shop-products.json'].file.slice(1)),'utf8')); const {p,...metadata}=raw; const chunks=[];let maxBytes=0; for(let offset=0;offset