{"_id":"@byetool/json-exporter","_rev":"1-4d43a0793b18dcefdcdbe87ca5fa2b6b","name":"@byetool/json-exporter","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@byetool/json-exporter","version":"1.0.0","description":"A library that supports exporting json to .xls, .xlsx, .csv, .html, .xml, .json, .txt files in browser","types":"./lib/index.d.ts","main":"./lib/index.js","scripts":{"build:watch":"tsc --watch","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/ibyetool/json-exporter.git"},"keywords":["browser","json","export","excel","xls","xlsx","csv","html","xml","txt"],"author":{"name":"byetool"},"license":"MIT","bugs":{"url":"https://github.com/ibyetool/json-exporter/issues"},"homepage":"https://github.com/ibyetool/json-exporter#readme","dependencies":{"file-saver":"^2.0.5","xlsx":"^0.18.5"},"devDependencies":{"@types/file-saver":"^2.0.5"},"gitHead":"3137cd51d99f4518a25018383f68f2f78d474fe7","_id":"@byetool/json-exporter@1.0.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-w+jeudWT8w10cOEEDsY/TZjcoPdTkA4TH+h03WOcA2lFxCscZmgLSfHv7QTssT+LOWudDF0mrMnmcqpmLJzkXA==","shasum":"a5d95bc3262933cd2d83112666932888ef0a1f17","tarball":"https://registry.npmjs.org/@byetool/json-exporter/-/json-exporter-1.0.0.tgz","fileCount":8,"unpackedSize":13312,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDq/G7i9wVuXOwoWBsKVEPVZ6YrBdtELm9DL+vv2foDXQIhALLZc5kLjVeJnTR3rKQH8vivVS0t8JzaYYeSqW+F8kaW"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkKM4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmra1RAAisEz2ZV8Ymup7C3QuFRnU3/veaLGQm+dIzkKgpVuzl5jhh9v\r\nejvbzcinNac7u48B48r1YAGRAynM9cruUgk3Gb6uLoyvd0rmUMm6wdSZ9ITM\r\n2UZFD68Nh6KQ+UoyNOU+nA6zFXKCz3iT1POPKP/26BNMmP9OpSScbY/rB91r\r\ncLs9yfzUNZfRywHbET4Dp90RZxZV8ibwlBlfil3kjIKkMAUnEsuTOcIFvJ7M\r\nHJN465k1HrW3Bvz7sM9ZEHassAhmScB7hHRtyDBHYnHJcBD6TaxTeXbNGnR9\r\ngI0qgEOTMdEQD4mgTtr97ARJeohfygreFLPBbokOXXJJx6eQGLpRtIrot1dD\r\nSihmCDXrKcqdQ9ZmFEc4d23+K/2mX15VSNaCjK1CuXn0AqaiBdUf3qIgIe/B\r\nGGIqMf47FLYVSznpM8UtZrElKQT7Tr/KrYMn5ze4EUs+kenuu/MBWVemMTK2\r\n1brFbLAq5zsD63LaV0fFJmcg8z2OLarQ/lrF4nG9Zs6Tl8m4WtSwoUUrwA1D\r\nYZlrEuVn3Lw0RFbaVefI87TmuA7qxaxGjARud3BgUF7jn6hbsMfHZPYw268o\r\nwqwbBtbKv8o31PduCM7fkiK2ZsV18+sXYqOFiKTNKAViUCjr32fGJJkAULXB\r\ncvi7Ig/Fqx4GJ3tW2XpR9lf2+3ho9VMnI1M=\r\n=moFI\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"byetool","email":"byetool@qq.com"},"directories":{},"maintainers":[{"name":"byetool","email":"byetool@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-exporter_1.0.0_1670423352035_0.31537585963679193"},"_hasShrinkwrap":false},"1.0.1":{"name":"@byetool/json-exporter","version":"1.0.1","description":"A library that supports exporting json to .xls, .xlsx, .csv, .html, .xml, .json, .txt files in browser","types":"./lib/index.d.ts","main":"./lib/index.js","scripts":{"build:watch":"tsc --watch","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/ibyetool/json-exporter.git"},"keywords":["browser","json","export","excel","xls","xlsx","csv","html","xml","txt"],"author":{"name":"byetool"},"license":"MIT","bugs":{"url":"https://github.com/ibyetool/json-exporter/issues"},"homepage":"https://github.com/ibyetool/json-exporter#readme","dependencies":{"file-saver":"^2.0.5","xlsx":"^0.18.5"},"devDependencies":{"@types/file-saver":"^2.0.5"},"_id":"@byetool/json-exporter@1.0.1","gitHead":"f4d8121b522f8ab7912ae6821f99a1ca217fd539","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-OOmEa6lpm8H+6Iu29TaFeOKXsh2M+P0pm+1w2rVXqtq1SaKWTCzH4KruaHebairRM/vrj9x1/W5auXG9T1uykQ==","shasum":"079a6c8de75243e5d92d849060d804c9b7dd5aad","tarball":"https://registry.npmjs.org/@byetool/json-exporter/-/json-exporter-1.0.1.tgz","fileCount":7,"unpackedSize":13281,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICY4y05vrf1Sr51wimVoJbQ+0/tIVvOMz6Dr7+Ugrns/AiEA+3QtQLod4dvGdWzWg5aukuHe0rk9kYWZJOKFGCqPcb8="}]},"_npmUser":{"name":"byetool","email":"byetool@qq.com"},"directories":{},"maintainers":[{"name":"byetool","email":"byetool@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-exporter_1.0.1_1708523127289_0.592554872357596"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-07T14:29:11.981Z","1.0.0":"2022-12-07T14:29:12.201Z","modified":"2024-02-21T13:45:27.954Z","1.0.1":"2024-02-21T13:45:27.544Z"},"maintainers":[{"name":"byetool","email":"byetool@qq.com"}],"description":"A library that supports exporting json to .xls, .xlsx, .csv, .html, .xml, .json, .txt files in browser","homepage":"https://github.com/ibyetool/json-exporter#readme","keywords":["browser","json","export","excel","xls","xlsx","csv","html","xml","txt"],"repository":{"type":"git","url":"git+https://github.com/ibyetool/json-exporter.git"},"author":{"name":"byetool"},"bugs":{"url":"https://github.com/ibyetool/json-exporter/issues"},"license":"MIT","readme":"# @byetool/json-exporter\n\nA library that supports exporting json to .xls, .xlsx, .csv, .html, .xml, .json, .txt files in browser.\n\n## Get Started\n\n```js\nimport exporter from '@byetool/json-exporter'\n\nconst data = [\n  {\n    id: 1,\n    title: 'Kinsley High Rise Pop Crop Jeans',\n    brand: 'AG',\n    price: '$225.00',\n  },\n  {\n    id: 2,\n    title: 'Stella Faux Leather Jeans',\n    brand: 'PAIGE',\n    price: '$229.00',\n  },\n  {\n    id: 3,\n    title: 'Rose Jeans',\n    brand: 'Wandler',\n    price: '$350.00',\n  },\n]\nconst filename = 'hello-world'\n\nexporter.toXLSX(data, filename, {\n  headers: ['title', 'price', 'brand'],\n})\n```\n\n## Methods\n\n7 easy-to-use APIs. Sign as below:\n\n```ts\ntoXLS(data: Obj[], filename: string, options?: Options)\n```\n\n- `toXLS` - Export json to .xls file\n- `toXLSX` - Export json to .xlsx file\n- `toCSV` - Export json to .csv file\n- `toHTML` - Export json to .html file\n- `toXML` - Export json to .xml file\n- `toJSON ` - Export json to .json file\n- `toText` - Export json to .txt file\n\n_NOTE: The filename without ext_\n\n## Options\n\nHere are the available options, except headers, other options come from `xlsx` module.\n\n| Param      | Type     | Default  | Description                                          |\n| ---------- | -------- | -------- | ---------------------------------------------------- |\n| headers    | Header[] | []       | Specify the order and alias of the header, see below |\n| dateNF     | string   | 'FMT 14' | Use specified date format in string output           |\n| cellDates  | boolean  | false    | Store dates as type `d` (default is `n`)             |\n| sheetStubs | boolean  | false    | Create cell objects of type `z` for `null` values    |\n\n## Headers\n\nSome usages of headers.\n\n1.Set order only, e.g.\n\n```js\nconst options = {\n  headers: ['title', 'price', 'brand'],\n}\n```\n\n2.Set alias for header, e.g.\n\n```js\nconst options = {\n  headers: [\n    { name: 'title', alias: 'Title' },\n    { name: 'price', alias: 'Price(USD)' },\n    { name: 'brand', alias: 'Brand' },\n  ],\n}\n```\n\n3.Choose the fields to output, e.g.\n\n```js\nconst data = [\n  { id: 1, foo: 'hello', bar: 'world' },\n  { id: 2, foo: '张三', bar: '李四' },\n]\n\n// Output `foo` and `bar` only\nconst options = {\n  headers: ['foo', 'bar'],\n}\n```\n\n## Other reference\n\nThis module is used in [Tapicker](https://www.tapicker.com/) and works fine.\n\n![tapicker](https://github.com/ibyetool/json-exporter/raw/main/images/tapicker.png)\n","readmeFilename":"README.md"}