This commit is contained in:
Jan Prochazka
2024-11-15 16:48:33 +01:00
parent c5d23410f4
commit 81e4b947b6
9 changed files with 58 additions and 11 deletions

View File

@@ -45,6 +45,17 @@ class ParseStream extends stream.Transform {
}
}
/**
* Creates reader object for JSON file for {@link copyStream} function.
* @param {object} options
* @param {string} options.fileName - file name or URL
* @param {string} options.jsonStyle - 'object' or 'array'
* @param {string} [options.keyField] - key field for object style
* @param {string} [options.rootField] - root field for object style
* @param {string} [options.encoding] - encoding of the file
* @param {number} [options.limitRows] - maximum number of rows to read
* @returns {Promise<readerType>} - reader object
*/
async function jsonReader({
fileName,
jsonStyle,