{"_id":"@elyse0/json-as-xlsx","_rev":"2-7f8a76c4a5a3b9be03787c8a8a416a11","name":"@elyse0/json-as-xlsx","dist-tags":{"latest":"2.4.3-esm"},"versions":{"2.4.1-esm":{"name":"@elyse0/json-as-xlsx","version":"2.4.1-esm","main":"src/index.js","license":"MIT","types":"types/index.d.ts","description":"Create excel xlsx file from json","author":{"name":"LuisEnMarroquin","email":"luis@marroquin.dev"},"homepage":"https://xlsx.marroquin.dev","scripts":{"start":"tsc --watch src/index.ts","build":"tsc src/index.ts && uglifyjs src/index.js --output src/index.js","start-client":"vue-cli-service serve","build-client":"vue-cli-service build","start-server":"npx nodemon --exec npx ts-node --skip-project examples/express/server.ts","test":"jest"},"dependencies":{"xlsx":"^0.17.2"},"devDependencies":{"@types/express":"^4.17.13","@types/jest":"^27.0.2","@types/node":"^17.0.0","@vue/cli-service":"^4.5.15","express":"^4.17.1","jest":"^27.3.1","ts-jest":"^27.0.7","typescript":"^4.4.3","uglify-js":"^3.14.2","vue":"^2.6.14","vue-template-compiler":"^2.6.14"},"repository":{"type":"git","url":"git+https://github.com/LuisEnMarroquin/json-as-xlsx.git"},"bugs":{"url":"https://github.com/LuisEnMarroquin/json-as-xlsx/issues"},"keywords":["json","xlsx","excel","jsonc","json-xlsx","xlsx-json","create-xlsx","create-excel","json-as-xlsx","json-to-xlsx","json-as-excel","json-to-excel","xlsx-as-json","xlsx-from-json","microsoft","microsoft-xlsx","microsoft-excel"],"browserslist":[">0.2%","not dead","not op_mini all"],"gitHead":"6478fcc39722ba47e06e1100cc911faee786521c","_id":"@elyse0/json-as-xlsx@2.4.1-esm","_nodeVersion":"16.14.2","_npmVersion":"8.11.0","dist":{"integrity":"sha512-5pne9xjLjXcXV1XKoIDg3hzwDBdLd+bD+wXUNrdkUxpPu2hbb3qo69WHrlpzO/shQ7ZK4FkbQGLcfAnS6jvBwQ==","shasum":"ad96626e08b119e9f84350f2d04f0162137342bb","tarball":"https://registry.npmjs.org/@elyse0/json-as-xlsx/-/json-as-xlsx-2.4.1-esm.tgz","fileCount":5,"unpackedSize":11690,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAcZj/kZ8IF9ysnNqLyk6jZ9URLrj0G/Ohzg/aoYW2LhAiEA2UJSqh0bslYZBaJP1nQZAxHsxp0oPqMu25IOn5oWJr8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3ieQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrXlQ/+OiocLNdF7uelC9F+7wjYAE2PCwc+WbjANVLKEOEVCbj3HsAl\r\nw2VQBm+T+BwssMkkCQ2hrMxBg1yABAEV0qu2pCQdplXC2OLVjYxC1KV7sAn7\r\nrxZGR7WN4F6IpS5CgHR59DX72w6OmihgA9RdmeSjgCDVCOBx1PM0TiLbHUeE\r\ntq3Zb2vAwo0M0VlXo57C8Jr1n1lxiiVrOX20VukEiP86PaLdrLaBZhW5C2ts\r\nhP8dQiDXjWIZY4ROmfCtYRj0v3PitzqOr9GFIAJcBeLvcswuZUsZIXSKxxJq\r\nFEBv4iOGRyjEnsK/tRyTK2JhuQXvIP1k/VARv8erVxbIFb04VrAowXzJP6M2\r\nwS2hSfgLHId83Ncti9+CsIK8iyhgogwdEUddV7N992x7LcSf5NPY1fpIFvde\r\nT0lpJMY9BEB/LrLcyESl8bTWgxc09n7TcETPZAiPILqC4OhdOOoz3EPZstw3\r\ngmt1VMiKTcWv/FicAOpPeqtX+FKeHI6hFtALBnZIc0NCZE62qzTlyxl6j3Z+\r\nP1kCdxR4P0cUP8QNHCxb6SuCb1oIzIC/+UT5HCQS5Eeo68uPhmLZ35JXatWD\r\nuw5egsPy/BZ9o1s/Jq1sn62qn+g5lGCHKHJN1W3W/7IfdhQJDg+rZBL0+LYJ\r\nbEDZ7Ehzn874VwgOQCNYbzFuLfyE+lEegCg=\r\n=iovZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"elyse0","email":"kevincristian@outlook.com"},"directories":{},"maintainers":[{"name":"elyse0","email":"kevincristian@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-as-xlsx_2.4.1-esm_1658726288341_0.12719828162435687"},"_hasShrinkwrap":false},"2.4.2-esm":{"name":"@elyse0/json-as-xlsx","version":"2.4.2-esm","main":"src/index.js","license":"MIT","types":"types/index.d.ts","description":"Create excel xlsx file from json","author":{"name":"LuisEnMarroquin","email":"luis@marroquin.dev"},"homepage":"https://xlsx.marroquin.dev","scripts":{"start":"tsc --watch src/index.ts","build":"tsc src/index.ts && uglifyjs src/index.js --output src/index.js","start-client":"vue-cli-service serve","build-client":"vue-cli-service build","start-server":"npx nodemon --exec npx ts-node --skip-project examples/express/server.ts","test":"jest"},"dependencies":{"xlsx":"^0.17.2"},"devDependencies":{"@types/express":"^4.17.13","@types/jest":"^27.0.2","@types/node":"^17.0.0","@vue/cli-service":"^4.5.15","express":"^4.17.1","jest":"^27.3.1","ts-jest":"^27.0.7","typescript":"^4.4.3","uglify-js":"^3.14.2","vue":"^2.6.14","vue-template-compiler":"^2.6.14"},"repository":{"type":"git","url":"git+https://github.com/LuisEnMarroquin/json-as-xlsx.git"},"bugs":{"url":"https://github.com/LuisEnMarroquin/json-as-xlsx/issues"},"keywords":["json","xlsx","excel","jsonc","json-xlsx","xlsx-json","create-xlsx","create-excel","json-as-xlsx","json-to-xlsx","json-as-excel","json-to-excel","xlsx-as-json","xlsx-from-json","microsoft","microsoft-xlsx","microsoft-excel"],"browserslist":[">0.2%","not dead","not op_mini all"],"gitHead":"2796c4b0fd769eb139fa88c2c4789800d3f63bb7","_id":"@elyse0/json-as-xlsx@2.4.2-esm","_nodeVersion":"16.14.2","_npmVersion":"8.11.0","dist":{"integrity":"sha512-HjfI/mA4DECZW5Jj4izHbp/E8llTM+0G1QA77CJq49C5WGQ6Tq18mcmXOSZpW0gcqOsLI5Nutkkg3g4n7w3fEg==","shasum":"0e2e863f70435cf26c36d45a1493725dd7479744","tarball":"https://registry.npmjs.org/@elyse0/json-as-xlsx/-/json-as-xlsx-2.4.2-esm.tgz","fileCount":5,"unpackedSize":11690,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJEwlQ9m/T63K9C2M7oOngLJd9OCcIxLmKkd13JDqaJAiEA+uwMY2R6Q1tddoaxWHxryKRMwJFKwBx/XZ3MdsEIvo8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3irdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmog2w/9FWnD2qbiX85q7MUHFjQBa1Howox7uNzn8GQ5IuHrXCQIPT0h\r\nRPqNPpLd7WNrn97OpgZDabKeKvykoe3I/GNnJ3c/I/RxMUOuJdoReHv1bHMP\r\nIgG5S8ciu1d2O3JIzCh1bRV6CbfmFZWrwU4pbHtfa2TZ5/0MoL7hCVfwzoHq\r\ngOIBCmoT3VdhIA8FuJF3Oby/pC467cY70xW6OMMZOA4gJAda3gP9UqiGehqv\r\nxoal39myDVzS9mc5emEGiA/wGpvM0JuAVIPkXQhCJPnrBp7Xtn5cORusGiDH\r\nhu/G9kIrVJATpN2fsIzGEbjffym0wsyGSj3o7mw2JizUHpyK70UrH6Ad7w64\r\nVPypPgmchtXRvwH98nnYvLBK8BE4pFbkqscmpxnJBWEvGLfwvOj3G2tHGd6R\r\nG6I6+alVNvXNT/WyqMEVlkg5YuVfneh4GUwHBuz+fn9czekviLRhA9BkfNGi\r\nbTbfqxQoXrOVEGlVgUraVL4DvAG4iNbyNfc8hmOCJo0AVo6j0igm32YHn2PT\r\n0lxqrpZE/A3AyRqW5Lo/47lSgKYB3bjFiQvN20Ygrce2oSmmBOIQY3d+6iQZ\r\nHKLKW6Po5maqlTLDxJpEimATcp5MV9J0Nlmm6cRo5u7j7UXMtTrzs3HOEBX/\r\n8rHq5D78x//QZwEnHb2Wj16UgrkEzp6Eo7M=\r\n=ce4t\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"elyse0","email":"kevincristian@outlook.com"},"directories":{},"maintainers":[{"name":"elyse0","email":"kevincristian@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-as-xlsx_2.4.2-esm_1658727133576_0.011920343736415484"},"_hasShrinkwrap":false},"2.4.3-esm":{"name":"@elyse0/json-as-xlsx","version":"2.4.3-esm","main":"src/index.js","license":"MIT","types":"types/index.d.ts","description":"Create excel xlsx file from json","author":{"name":"LuisEnMarroquin","email":"luis@marroquin.dev"},"homepage":"https://xlsx.marroquin.dev","scripts":{"start":"tsc --watch src/index.ts","build":"tsc src/index.ts && uglifyjs src/index.js --output src/index.js","start-client":"vue-cli-service serve","build-client":"vue-cli-service build","start-server":"npx nodemon --exec npx ts-node --skip-project examples/express/server.ts","test":"jest"},"dependencies":{"xlsx":"^0.17.2"},"devDependencies":{"@types/express":"^4.17.13","@types/jest":"^27.0.2","@types/node":"^17.0.0","@vue/cli-service":"^4.5.15","express":"^4.17.1","jest":"^27.3.1","ts-jest":"^27.0.7","typescript":"^4.4.3","uglify-js":"^3.14.2","vue":"^2.6.14","vue-template-compiler":"^2.6.14"},"repository":{"type":"git","url":"git+https://github.com/LuisEnMarroquin/json-as-xlsx.git"},"bugs":{"url":"https://github.com/LuisEnMarroquin/json-as-xlsx/issues"},"keywords":["json","xlsx","excel","jsonc","json-xlsx","xlsx-json","create-xlsx","create-excel","json-as-xlsx","json-to-xlsx","json-as-excel","json-to-excel","xlsx-as-json","xlsx-from-json","microsoft","microsoft-xlsx","microsoft-excel"],"browserslist":[">0.2%","not dead","not op_mini all"],"gitHead":"2796c4b0fd769eb139fa88c2c4789800d3f63bb7","_id":"@elyse0/json-as-xlsx@2.4.3-esm","_nodeVersion":"16.14.2","_npmVersion":"8.11.0","dist":{"integrity":"sha512-ScrjAbPH5o2Zxp6OdeamNlfANh4lLyHPHWM6hyTO1olFuDyVAIrDC+omzNzdAfCUK5c+nxuzNOQeTTpmaW8uYw==","shasum":"4b7a07f771ed8857a9700704dab78d76a0fc97b0","tarball":"https://registry.npmjs.org/@elyse0/json-as-xlsx/-/json-as-xlsx-2.4.3-esm.tgz","fileCount":5,"unpackedSize":11690,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZ4kE+MhRIqAWadbqqvtC83j1PmqHV4aMi/rbD921hOAiEAk/CSxMFKPbEg4F+PG9wguAVXOIXS96F5rLBjLcDPuJM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3itrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrlfBAApL/SiU1XTp3t4BksGeaAYeBumYwXwfpQsrcqnG9ir4jLmxpd\r\nwH/SabLN1tOZe1Gq/09GY2KQ+C7yEwHmJVUBtaW0P7HNh9/plySMNHQAUucZ\r\nRQujySLNBtW01OBvPfD+iFERkaWDMz/jNVsdFqjQIzPKaH0riR2axyCI/6o5\r\nBfomuDab21wBs1GH8whxiCXTV1zkBC6v9W0cZOw7HnvHpmrHOKs40HVVY0Lu\r\nsji06VxV7UlCSJvkbUORqyPesAg6N7fo8bt/3sRwqdrAkg/oU1h/Bqbjp0pZ\r\nz3xS/cF3WOYpOLav2LqvAXkCXfvcPj5ARUl8sji1Qe9kUAe8pJqHYIShCHqp\r\nhJecyrJPqkvLGXZjtDirmRtXXuBPjNxZ2ftC3wWTw2LL+S9i/6DFF8vDJeiE\r\nxZ2EY9mu90kJUnfr0KBlkBKMRDTX/VdkGV2RcOEJBjewKt4+AlzohJwtxIdV\r\nFkb0tCXYaEFRjRkDYpZTP9c55zhyrPs5xykG1npeAkbcwf/dPqxNuYXifG7D\r\ndfI9hPB68V3oWDvuvKfLuWDP4dYZzDyTMB0t3Lbx+5l4H+IE79MPPq5+1r6A\r\nJRlYY1CrQflC6HJ0Q6x7CG5+CwDpPdTRuDIuP21N3ejj5Qvmz1oQP8QeCIkb\r\nh1fx2GSoK9+0DIUmAVtzvko5tRs2UnR/u2c=\r\n=BbI6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"elyse0","email":"kevincristian@outlook.com"},"directories":{},"maintainers":[{"name":"elyse0","email":"kevincristian@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-as-xlsx_2.4.3-esm_1658727275246_0.8801364339981796"},"_hasShrinkwrap":false}},"time":{"created":"2022-07-25T05:18:08.216Z","2.4.1-esm":"2022-07-25T05:18:08.531Z","modified":"2022-07-25T05:34:35.493Z","2.4.2-esm":"2022-07-25T05:32:13.901Z","2.4.3-esm":"2022-07-25T05:34:35.401Z"},"maintainers":[{"name":"elyse0","email":"kevincristian@outlook.com"}],"description":"Create excel xlsx file from json","homepage":"https://xlsx.marroquin.dev","keywords":["json","xlsx","excel","jsonc","json-xlsx","xlsx-json","create-xlsx","create-excel","json-as-xlsx","json-to-xlsx","json-as-excel","json-to-excel","xlsx-as-json","xlsx-from-json","microsoft","microsoft-xlsx","microsoft-excel"],"repository":{"type":"git","url":"git+https://github.com/LuisEnMarroquin/json-as-xlsx.git"},"author":{"name":"LuisEnMarroquin","email":"luis@marroquin.dev"},"bugs":{"url":"https://github.com/LuisEnMarroquin/json-as-xlsx/issues"},"license":"MIT","readme":"# json-as-xlsx\n\nThis is a tool that helps to build an excel from a json and it depends only on `xlsx` library\n\nYou can see a live example of it working on any of this sites (there are many just in case):\n\n- [xlsx.pages.dev](https://xlsx.pages.dev)\n- [xlsx.marroquin.dev](https://xlsx.marroquin.dev)\n- [xlsx.luismarroquin.com](https://xlsx.luismarroquin.com)\n\n## Usage\n\n```js\nlet xlsx = require(\"json-as-xlsx\")\n\nlet data = [\n  {\n    sheet: \"Adults\",\n    columns: [\n      { label: \"User\", value: \"user\" }, // Top level data\n      { label: \"Age\", value: (row) => row.age + \" years\" }, // Custom format\n      { label: \"Phone\", value: (row) => (row.more ? row.more.phone || \"\" : \"\") }, // Run functions\n    ],\n    content: [\n      { user: \"Andrea\", age: 20, more: { phone: \"11111111\" } },\n      { user: \"Luis\", age: 21, more: { phone: \"12345678\" } },\n    ],\n  },\n  {\n    sheet: \"Children\",\n    columns: [\n      { label: \"User\", value: \"user\" }, // Top level data\n      { label: \"Age\", value: \"age\", format: '# \"years\"' }, // Column format\n      { label: \"Phone\", value: \"user.more.phone\", format: \"(###) ###-####\" }, // Deep props and column format\n    ],\n    content: [\n      { user: \"Manuel\", age: 16, more: { phone: 9999999900 } },\n      { user: \"Ana\", age: 17, more: { phone: 8765432135 } },\n    ],\n  },\n]\n\nlet settings = {\n  fileName: \"MySpreadsheet\", // Name of the resulting spreadsheet\n  extraLength: 3, // A bigger number means that columns will be wider\n  writeOptions: {}, // Style options from https://github.com/SheetJS/sheetjs#writing-options\n}\n\nxlsx(data, settings) // Will download the excel file\n```\n\nIf you want to trigger something after the file is downloaded, you can use the `callback` parameter:\n\n```js\nlet callback = function (sheet) {\n  console.log(\"Download complete:\", sheet)\n}\n\nxlsx(data, settings, callback) // Will download the excel file\n```\n\n### Column formatting\n\n> **Note:** Cell formatting is type based, i.e. the format type and value type must match.\n>\n> If you want to use a Date format, the value must be of type Date; if you want a number format, the value must be a Number.\n\nColumn formatting can be provided in the column object, i.e.\n\n```js\ncolumns: [{ label: \"Income\", value: \"income\", format: \"€#,##0.00\" }]\n```\n\n- A list of SheetJS format examples can be found\n  here: [SSF library](https://github.com/SheetJS/sheetjs/blob/f443aa8475ebf051fc4e888cf0a6c3e5b751813c/bits/10_ssf.js#L42)\n- ECMA-376 number formatting\n  specification: [Number formats](https://c-rex.net/projects/samples/ooxml/e1/Part4/OOXML_P4_DOCX_numFmts_topic_ID0E6KK6.html)\n\nExamples\n\n```js\n// Number formats\n\n\"$0.00\" // Basic\n\"\\£#,##0.00\" // Pound\n\"0%\" // Percentage\n'#.# \"ft\"' // Number and text\n\n// Date formats\n\"d-mmm-yy\" // 12-Mar-22\n\"ddd\" // (eg. Sat)\n\"dddd\" // (eg. Saturday)\n\"h:mm AM/PM\" // 1:10 PM\n```\n\n## Examples\n\nThis are files used for development, please change imports from `../../src/index.js` to `json-as-xlsx`\n\n- [VueJS with JavaScript](https://github.com/LuisEnMarroquin/json-as-xlsx/blob/main/examples/vue-app/App.vue)\n- [Express with TypeScript](https://github.com/LuisEnMarroquin/json-as-xlsx/blob/main/examples/express/server.ts)\n","readmeFilename":"README.md"}