read-excel-file
Version:
Read small to medium `*.xlsx` files in a browser or Node.js. Parse to JSON with a strict schema.
17 lines (16 loc) • 568 B
JavaScript
import readXlsxFile from './readXlsxFileNode.js';
/**
* Reads the list of sheet names in an XLSX file in Node.js.
* @param {(string|Stream|Buffer)} input - A Node.js readable stream or a `Buffer` or a path to a file.
* @return {Promise} Resolves to an array of objects of shape `{ name: string }`.
*/
export default function readSheetNames(input) {
return readXlsxFile(input, {
getSheets: true
}).then(function (sheets) {
return sheets.map(function (sheet) {
return sheet.name;
});
});
}
//# sourceMappingURL=readSheetNamesNode.js.map