All Projects β†’ LuisEnMarroquin β†’ json-as-xlsx

LuisEnMarroquin / json-as-xlsx

Licence: MIT license
Create excel from json npm package

Programming Languages

typescript
32286 projects
HTML
75241 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to json-as-xlsx

express-mvc-generator
Express' Model View Controller Application Generator.
Stars: ✭ 46 (-55.34%)
Mutual labels:  npm-module, node-js
react-full-stack-starter
🎈Full-stack React boilerplate using `create-react-app`, Babel, Node.js, and express
Stars: ✭ 22 (-78.64%)
Mutual labels:  full-stack, node-js
Rando.js
The world's easiest, most powerful random function.
Stars: ✭ 659 (+539.81%)
Mutual labels:  npm-module, node-js
arcscord
A Discord library written in typescript
Stars: ✭ 18 (-82.52%)
Mutual labels:  npm-module, node-js
Documentserver
ONLYOFFICE Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
Stars: ✭ 2,335 (+2166.99%)
Mutual labels:  xlsx, node-js
MinifyAllCli
πŸ“¦ A lightweight, simple and easy npm tool to π—Ίπ—Άπ—»π—Άπ—³π˜† JSON/C, HTML and CSS! Also known as MinifyAll core! ⭐ Usable as π‘ͺ𝑳𝑰 tool or π’Šπ’Žπ’‘π’π’“π’•π’‚π’ƒπ’π’† in TS/JS as a 𝑴𝑢𝑫𝑼𝑳𝑬 πŸ₯°
Stars: ✭ 21 (-79.61%)
Mutual labels:  npm-module, client-side
Forge Node App
πŸ› πŸ“¦πŸŽ‰ Generate Node.js boilerplate with optional libraries & tools
Stars: ✭ 90 (-12.62%)
Mutual labels:  npm-module, node-js
react-strap-table
react table (client and server-side) based on bootstrap.
Stars: ✭ 28 (-72.82%)
Mutual labels:  client-side, server-side
Documentbuilder
ONLYOFFICE Document Builder is powerful text, spreadsheet, presentation and PDF generating tool
Stars: ✭ 61 (-40.78%)
Mutual labels:  xlsx, node-js
xlsx-reader
xlsx-reader is a PHP library for fast and efficient reading of XLSX spreadsheet files. Its focus is on reading the data contained within XLSX files, disregarding all document styling beyond that which is strictly necessary for data type recognition. It is built to be usable for very big XLSX files in the magnitude of multiple GBs.
Stars: ✭ 40 (-61.17%)
Mutual labels:  xlsx, xlsx-spreadsheet
Protoo
Minimalist and extensible Node.js signaling framework for multi-party Real-Time applications
Stars: ✭ 109 (+5.83%)
Mutual labels:  client-side, server-side
ifto
A simple debugging module for AWS Lambda (Ξ») timeout
Stars: ✭ 72 (-30.1%)
Mutual labels:  npm-module, node-js
Quell
Quell is an easy-to-use, lightweight JavaScript library providing a client- and server-side caching solution for GraphQL. Use Quell to prevent redundant client-side API requests and to minimize costly server-side response latency.
Stars: ✭ 90 (-12.62%)
Mutual labels:  client-side, server-side
windows-network-drive
Do network drive stuff on Microsoft Window in node
Stars: ✭ 18 (-82.52%)
Mutual labels:  npm-module, node-js
Logbook
An extensible Java library for HTTP request and response logging
Stars: ✭ 822 (+698.06%)
Mutual labels:  client-side, server-side
Node Loadbalance
A collection of distilled load balancing engines
Stars: ✭ 79 (-23.3%)
Mutual labels:  npm-module, node-js
prototyped.js
Some common Typescript prototypes
Stars: ✭ 22 (-78.64%)
Mutual labels:  client-side, server-side
showroom
Universal development and automated test environment for web components
Stars: ✭ 89 (-13.59%)
Mutual labels:  client-side, server-side
Reactjs Portfolio Mern Website
My Portfolio | Full Stack MERN Application
Stars: ✭ 25 (-75.73%)
Mutual labels:  full-stack, server-side
Quell
Quell is an easy-to-use, lightweight JavaScript library providing a client- and server-side caching solution for GraphQL. Use Quell to prevent redundant client-side API requests and to minimize costly server-side response latency.
Stars: ✭ 473 (+359.22%)
Mutual labels:  client-side, server-side

json-as-xlsx

This is a tool that helps to build an excel from a json and it depends only on xlsx library

You can see a live example of it working on any of this sites (there are many just in case):

Usage

import xlsx from "json-as-xlsx"
// or require
let xlsx = require("json-as-xlsx")

let data = [
  {
    sheet: "Adults",
    columns: [
      { label: "User", value: "user" }, // Top level data
      { label: "Age", value: (row) => row.age + " years" }, // Custom format
      { label: "Phone", value: (row) => (row.more ? row.more.phone || "" : "") }, // Run functions
    ],
    content: [
      { user: "Andrea", age: 20, more: { phone: "11111111" } },
      { user: "Luis", age: 21, more: { phone: "12345678" } },
    ],
  },
  {
    sheet: "Children",
    columns: [
      { label: "User", value: "user" }, // Top level data
      { label: "Age", value: "age", format: '# "years"' }, // Column format
      { label: "Phone", value: "more.phone", format: "(###) ###-####" }, // Deep props and column format
    ],
    content: [
      { user: "Manuel", age: 16, more: { phone: 9999999900 } },
      { user: "Ana", age: 17, more: { phone: 8765432135 } },
    ],
  },
]

let settings = {
  fileName: "MySpreadsheet", // Name of the resulting spreadsheet
  extraLength: 3, // A bigger number means that columns will be wider
  writeMode: "writeFile", // The available parameters are 'WriteFile' and 'write'. This setting is optional. Useful in such cases https://docs.sheetjs.com/docs/solutions/output#example-remote-file
  writeOptions: {}, // Style options from https://docs.sheetjs.com/docs/api/write-options
  RTL: true, // Display the columns from right-to-left (the default value is false)
}

xlsx(data, settings) // Will download the excel file

If you want to trigger something after the file is downloaded, you can use the callback parameter:

let callback = function (sheet) {
  console.log("Download complete:", sheet)
}

xlsx(data, settings, callback) // Will download the excel file

Column formatting

Note: Cell formatting is type based, i.e. the format type and value type must match.

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.

Column formatting can be provided in the column object, i.e.

columns: [{ label: "Income", value: "income", format: "€#,##0.00" }]

Examples

// Number formats
"$0.00" // Basic
"\Β£#,##0.00" // Pound
"0%" // Percentage
'#.# "ft"' // Number and text

// Date formats
"d-mmm-yy" // 12-Mar-22
"ddd" // (eg. Sat)
"dddd" // (eg. Saturday)
"h:mm AM/PM" // 1:10 PM

Examples

This are files used for development, please change imports from ../../src/index to json-as-xlsx

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].