{"_id":"@42technologies/node-xlsx","name":"@42technologies/node-xlsx","dist-tags":{"latest":"0.23.0"},"versions":{"0.23.0":{"name":"@42technologies/node-xlsx","author":{"name":"Olivier Louvignes","email":"olivier@mg-crea.com"},"version":"0.23.0","description":"NodeJS Excel files parser & builder","main":"lib/index.js","types":"lib/index.d.ts","bin":{"node-xlsx":"lib/bin/cli.js"},"scripts":{"start":"npm run spec -- --watch","build":"rimraf lib/*; tsc --build","lint":"eslint src/ test/","prettycheck":"prettier --check src/ test/","typecheck":"tsc --noEmit","spec":"jest --runInBand","test":"npm run lint && npm run prettycheck && npm run typecheck && npm run spec","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/42technologies/node-xlsx.git"},"license":"Apache-2.0","dependencies":{"xlsx":"https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz"},"devDependencies":{"@jest/globals":"^29.5.0","@tsconfig/node10":"^1.0.9","@types/jest":"^29.5.1","@types/sodium-native":"^2.3.5","@typescript-eslint/eslint-plugin":"^5.59.7","@typescript-eslint/parser":"^5.59.7","eslint":"^8.41.0","eslint-config-prettier":"^8.8.0","eslint-plugin-jest":"^27.2.1","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","prettier":"^2.8.8","rimraf":"^5.0.1","ts-jest":"^29.1.0","ts-node":"^10.9.1","typescript":"^5.0.4"},"engines":{"node":">=10.0.0"},"keywords":["excel","parser","builder","xlsx","xls"],"volta":{"node":"18.17.1"},"_id":"@42technologies/node-xlsx@0.23.0","gitHead":"b748fbef56f0abffc8618150d594c9cc71a3865c","bugs":{"url":"https://github.com/42technologies/node-xlsx/issues"},"homepage":"https://github.com/42technologies/node-xlsx#readme","_nodeVersion":"18.17.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-viU5zkXsBm/9LLWYpSGwrjEsW1nEAT6NLemwTMxcfUs7zrQB+95GOYosVs6SVncn/l00KSpRMO18FHZr1Kd4NA==","shasum":"999df87a0181570b83caf85a541a203826faf4d2","tarball":"https://registry.npmjs.org/@42technologies/node-xlsx/-/node-xlsx-0.23.0.tgz","fileCount":11,"unpackedSize":14719,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCy/pg4o/CpQU8sMspy0TbXrPu9/Hi1vF5ezB9R/BFP2AIhAPgSqnlrK4Hm+OpXyx/2UBXedsUGucmpNVPysz4Q+Opa"}]},"_npmUser":{"name":"nickporter42","email":"nick@42technologies.com"},"directories":{},"maintainers":[{"name":"lbutzmann","email":"lars.butzmann@gmail.com"},{"name":"surjikal","email":"npm@surj.email"},{"name":"nickporter42","email":"nick@42technologies.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-xlsx_0.23.0_1693871072911_0.24600716144798174"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-04T23:44:32.750Z","0.23.0":"2023-09-04T23:44:33.085Z","modified":"2023-09-04T23:44:33.430Z"},"maintainers":[{"name":"lbutzmann","email":"lars.butzmann@gmail.com"},{"name":"surjikal","email":"npm@surj.email"},{"name":"nickporter42","email":"nick@42technologies.com"}],"description":"NodeJS Excel files parser & builder","homepage":"https://github.com/42technologies/node-xlsx#readme","keywords":["excel","parser","builder","xlsx","xls"],"repository":{"type":"git","url":"git+https://github.com/42technologies/node-xlsx.git"},"author":{"name":"Olivier Louvignes","email":"olivier@mg-crea.com"},"bugs":{"url":"https://github.com/42technologies/node-xlsx/issues"},"license":"Apache-2.0","readme":"<!-- markdownlint-disable no-inline-html -->\n\n# node-xlsx\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/node-xlsx\">\n    <img src=\"https://img.shields.io/npm/v/node-xlsx.svg?style=for-the-badge\" alt=\"npm version\" />\n  </a>\n  <a href=\"https://www.npmjs.com/package/node-xlsx\">\n    <img src=\"https://img.shields.io/npm/dt/node-xlsx.svg?style=for-the-badge\" alt=\"npm total downloads\" />\n  </a>\n  <a href=\"https://www.npmjs.com/package/node-xlsx\">\n    <img src=\"https://img.shields.io/npm/dm/node-xlsx.svg?style=for-the-badge\" alt=\"npm monthly downloads\" />\n  </a>\n  <a href=\"https://www.npmjs.com/package/node-xlsx\">\n    <img src=\"https://img.shields.io/npm/l/node-xlsx.svg?style=for-the-badge\" alt=\"npm license\" />\n  </a>\n  <a href=\"https://github.com/mgcrea/node-xlsx/actions/workflows/main.yml\">\n    <img src=\"https://img.shields.io/github/workflow/status/mgcrea/node-xlsx/main?style=for-the-badge\" alt=\"github main workflow\" />\n  </a>\n</p>\n\n## Features\n\nStraightforward excel file parser and builder.\n\n- Relies on [SheetJS xlsx](https://github.com/SheetJS/sheetjs) module to parse/build excel sheets.\n- Built with [TypeScript](https://www.typescriptlang.org/) for static type checking with exported types along the\n  library.\n\n## Install\n\n```bash\nnpm install node-xlsx --save\n```\n\n## Quickstart\n\n### Parse an xlsx file\n\n```js\nimport xlsx from 'node-xlsx';\n// Or var xlsx = require('node-xlsx').default;\n\n// Parse a buffer\nconst workSheetsFromBuffer = xlsx.parse(fs.readFileSync(`${__dirname}/myFile.xlsx`));\n// Parse a file\nconst workSheetsFromFile = xlsx.parse(`${__dirname}/myFile.xlsx`);\n```\n\n### Build an xlsx file\n\n```js\nimport xlsx from 'node-xlsx';\n// Or var xlsx = require('node-xlsx').default;\n\nconst data = [\n  [1, 2, 3],\n  [true, false, null, 'sheetjs'],\n  ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'],\n  ['baz', null, 'qux'],\n];\nvar buffer = xlsx.build([{name: 'mySheetName', data: data}]); // Returns a buffer\n```\n\n### Custom column width\n\n```js\nimport xlsx from 'node-xlsx';\n// Or var xlsx = require('node-xlsx').default;\n\nconst data = [\n  [1, 2, 3],\n  [true, false, null, 'sheetjs'],\n  ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'],\n  ['baz', null, 'qux'],\n];\nconst sheetOptions = {'!cols': [{wch: 6}, {wch: 7}, {wch: 10}, {wch: 20}]};\n\nvar buffer = xlsx.build([{name: 'mySheetName', data: data}], {sheetOptions}); // Returns a buffer\n```\n\n### Spanning multiple rows `A1:A4` in every sheets\n\n```js\nimport xlsx from 'node-xlsx';\n// Or var xlsx = require('node-xlsx').default;\n\nconst data = [\n  [1, 2, 3],\n  [true, false, null, 'sheetjs'],\n  ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'],\n  ['baz', null, 'qux'],\n];\nconst range = {s: {c: 0, r: 0}, e: {c: 0, r: 3}}; // A1:A4\nconst sheetOptions = {'!merges': [range]};\n\nvar buffer = xlsx.build([{name: 'mySheetName', data: data}], {sheetOptions}); // Returns a buffer\n```\n\n### Spanning multiple rows `A1:A4` in second sheet\n\n```js\nimport xlsx from 'node-xlsx';\n// Or var xlsx = require('node-xlsx').default;\n\nconst dataSheet1 = [\n  [1, 2, 3],\n  [true, false, null, 'sheetjs'],\n  ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'],\n  ['baz', null, 'qux'],\n];\nconst dataSheet2 = [\n  [4, 5, 6],\n  [7, 8, 9, 10],\n  [11, 12, 13, 14],\n  ['baz', null, 'qux'],\n];\nconst range = {s: {c: 0, r: 0}, e: {c: 0, r: 3}}; // A1:A4\nconst sheetOptions = {'!merges': [range]};\n\nvar buffer = xlsx.build([\n  {name: 'myFirstSheet', data: dataSheet1},\n  {name: 'mySecondSheet', data: dataSheet2, options: sheetOptions},\n]); // Returns a buffer\n```\n\n_Beware that if you try to merge several times the same cell, your xlsx file will be seen as corrupted._\n\n- Using Primitive Object Notation Data values can also be specified in a non-abstracted representation.\n\nExamples:\n\n```js\nconst rowAverage = [[{t: 'n', z: 10, f: '=AVERAGE(2:2)'}], [1, 2, 3]];\nvar buffer = xlsx.build([{name: 'Average Formula', data: rowAverage}]);\n```\n\nRefer to [xlsx](https://sheetjs.gitbooks.io) documentation for valid structure and values:\n\n- [cell object]: (https://sheetjs.gitbooks.io/docs/#cell-object)\n- [data types]: (https://sheetjs.gitbooks.io/docs/#data-types)\n- [Format](https://sheetjs.gitbooks.io/docs/#number-formats)\n\n### Troubleshooting\n\nThis library requires at least node.js v10. For legacy versions, you can use this workaround before using the lib.\n\n```sh\nnpm i --save object-assign\n```\n\n```js\nObject.prototype.assign = require('object-assign');\n```\n\n### Contributing\n\nPlease submit all pull requests the against master branch. If your unit test contains javascript patches or features,\nyou should include relevant unit tests. Thanks!\n\n### Available scripts\n\n| **Script**    | **Description**                |\n| ------------- | ------------------------------ |\n| start         | Alias of test:watch            |\n| test          | Run mocha unit tests           |\n| test:watch    | Run and watch mocha unit tests |\n| lint          | Run eslint static tests        |\n| compile       | Compile the library            |\n| compile:watch | Compile and watch the library  |\n\n## Authors\n\n**Olivier Louvignes**\n\n- http://olouv.com\n- http://github.com/mgcrea\n\n## Copyright and license\n\n[Apache License 2.0](https://spdx.org/licenses/Apache-2.0.html)\n\n```\nCopyright (C) 2012-2014  Olivier Louvignes\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\nExcept where noted, this license applies to any and all software programs and associated documentation files created by the Original Author and distributed with the Software:\n\nInspired by SheetJS gist examples, Copyright (c) SheetJS.\n```\n","readmeFilename":"README.md"}