Helpers

eachSnapshot.mjs

@mr_ozio/scraper-utils · v2.5.0 · Generated April 21, 2026

Target Style

Target Style

2 exports

const

forEachSnapshot

Target Style
export const forEachSnapshot = async ({ in: snapshotPath, ...options }) => {

Iterates through snapshot files in a directory.

Target style API. Preferred for new code.

Parameters

  • options{ in: string, callback: Function, onProgress?: Function, filter?: Function, shouldReadFile?: boolean, progressInterval?: number }

Returns

Promise<void>

const

readEachSnapshot

Target Style
export const readEachSnapshot = async ({ in: snapshotPath, ...options }) => {

Iterates through snapshot files and reads their contents automatically.

Target style API. Preferred for new code.

Parameters

  • options{ in: string, callback: Function, onProgress?: Function, filter?: Function, progressInterval?: number }

Returns

Promise<void>

Example

await readEachSnapshot({
  in: './snapshots',
  callback: async ({ html }) => {
    console.log(html.length)
  },
})

Legacy Style

Legacy Style

1 exports

const

eachSnapshot

Legacy Style
export const eachSnapshot = async ({ snapshotPath, ...options }) => {

Iterates through snapshot files in a directory.

Legacy API. Kept for older code and not the preferred choice for new code.

Parameters

  • {snapshotPath: string, callback: Function, onProgress?: Function, filter?: Function, shouldReadFile?: boolean, progressInterval?: number }} options

Returns

Promise<void>