Skip to content

Releases: LuisEnMarroquin/json-as-xlsx

Released v1.1.7

10 Oct 23:27
Compare
Choose a tag to compare

json-as-xlsx

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

You can see a live example of how it works on this site: luisenmarroquin.github.io/json-as-xlsx

Usage

Just import and use it

var xlsx = require('json-as-xlsx')

var columns = [
  { label: 'Email', value: 'email' }, // Top level data
  { label: 'Age', value: row => (row.age + ' years') }, // Run functions
  { label: 'Password', value: row => (row.hidden ? row.hidden.password : '') }, // Deep props
]

var content = [
  { email: 'Ana', age: 16, hidden: { password: '11111111' } },
  { email: 'Luis', age: 19, hidden: { password: '12345678' } }
]

var settings = {
  sheetName: 'First sheet', // The name of the sheet
  fileName: 'Users', // The name of the spreadsheet
  extraLength: 3, // A bigger number means that columns should be wider
  writeOptions: {} // Style options from https://github.com/SheetJS/sheetjs#writing-options
}

var download = true // If true will download the xlsx file, otherwise will return a buffer

xlsx(columns, content, settings, download) // Will download the excel file

Examples

This are my files used for development, remember to change:

require('./index.js') and require('../index.js') to require('json-as-xlsx')

Released v1.1.6

10 Oct 00:15
Compare
Choose a tag to compare

json-as-xlsx

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

You can see a live example of how it works on this site: luisenmarroquin.github.io/json-as-xlsx

Usage

Just import and use it

var xlsx = require('json-as-xlsx')

var columns = [
  { label: 'Email', value: 'email' }, // Top level data
  { label: 'Age', value: row => (row.age + ' years') }, // Run functions
  { label: 'Password', value: row => (row.hidden ? row.hidden.password : '') }, // Deep props
]

var content = [
  { email: 'Ana', age: 16, hidden: { password: '11111111' } },
  { email: 'Luis', age: 19, hidden: { password: '12345678' } }
]

var settings = {
  sheetName: 'First sheet', // The name of the sheet
  fileName: 'Users', // The name of the spreadsheet
  extraLength: 3 // A bigger number means that columns should be wider
}

var download = true // If true will download the xlsx file, otherwise will return a buffer

xlsx(columns, content, settings, download) // Will download the excel file

Examples

This are my files used for development, remember to change:

require('./index.js') and require('../index.js') to require('json-as-xlsx')

Released v1.1.4

05 Sep 18:01
Compare
Choose a tag to compare

json-as-xlsx

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

You can see a live example of how it works on this site: luisenmarroquin.github.io/json-as-xlsx

Usage

Just import and use it

var xlsx = require('json-as-xlsx')

var columns = [
  { label: 'Email', value: 'email' }, // Top level data
  { label: 'Age', value: row => (row.age + ' years') }, // Run functions
  { label: 'Password', value: row => (row.hidden ? row.hidden.password : '') }, // Deep props
]

var content = [
  { email: 'Ana', age: 16, hidden: { password: '11111111' } },
  { email: 'Luis', age: 19, hidden: { password: '12345678' } }
]

var settings = {
  sheetName: 'First sheet', // The name of the sheet
  fileName: 'Users', // The name of the spreadsheet
  extraLength: 3 // A bigger number means that columns should be wider
}

var download = true // If true will download the xlsx file, otherwise will return a buffer

xlsx(columns, content, settings, download) // Will download the excel file

Examples

This are my files used for development, remember to change:

require('./index.js') and require('../index.js') to require('json-as-xlsx')

Released v1.1.3

27 Aug 00:03
Compare
Choose a tag to compare

json-as-xlsx

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

You can see a live example of how it works on this site: luisenmarroquin.github.io/json-as-xlsx

Usage

Just import and use it

var xlsx = require('json-as-xlsx')

var columns = [
  { label: 'Email', value: 'email' }, // Top level data
  { label: 'Age', value: row => (row.age + ' years') }, // Run functions
  { label: 'Password', value: row => (row.hidden ? row.hidden.password : '') }, // Deep props
]

var content = [
  { email: 'Ana', age: 16, hidden: { password: '11111111' } },
  { email: 'Luis', age: 19, hidden: { password: '12345678' } }
]

var settings = {
  sheetName: 'First sheet', // The name of the sheet
  fileName: 'Users', // The name of the spreadsheet
  extraLength: 3 // A bigger number means that columns should be wider
}

var download = true // If true will download the xlsx file, otherwise will return a buffer

xlsx(columns, content, settings, download) // Will download the excel file

Examples

This are my files used for development, remember to change:

require('./index.js') and require('../index.js') for require('json-as-xlsx')

Released v1.1.2

26 Aug 23:35
Compare
Choose a tag to compare

json-as-xlsx

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

You can see a live example of how it works on this site: luisenmarroquin.github.io/json-as-xlsx

Usage

Just import and use it

var xlsx = require('json-as-xlsx')

var columns = [
  { label: 'Email', value: 'email' }, // Top level data
  { label: 'Age', value: row => (row.age + ' years') }, // Run functions
  { label: 'Password', value: row => (row.hidden ? row.hidden.password : '') }, // Deep props
]

var content = [
  { email: 'Ana', age: 16, hidden: { password: '11111111' } },
  { email: 'Luis', age: 19, hidden: { password: '12345678' } }
]

var settings = {
  sheetName: 'First sheet', // The name of the sheet
  fileName: 'Users', // The name of the spreadsheet
  extraLength: 3 // A bigger number means that columns should be wider
}

var download = true // If true will download the xlsx file, otherwise will return a buffer

xlsx(columns, content, settings, download) // Will download the excel file

Examples

This are my files used for development, remember to change:

require('./index.js') and require('../index.js') for require('json-as-xlsx')

Released v1.1.1

26 Aug 05:12
Compare
Choose a tag to compare

json-as-xlsx

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

You can see a live example of how it works on this site: luisenmarroquin.github.io/json-as-xlsx

Usage

Just import and use it

var xlsx = require('json-as-xlsx')

var columns = [
  { label: 'Email', value: 'email' }, // Top level data
  { label: 'Age', value: row => (row.age + ' years') }, // Run functions
  { label: 'Password', value: row => (row.hidden ? row.hidden.password : '') }, // Deep props
]

var content = [
  { email: 'Ana', age: 16, hidden: { password: '11111111' } },
  { email: 'Luis', age: 19, hidden: { password: '12345678' } }
]

var settings = {
  sheetName: 'First sheet', // The name of the sheet
  fileName: 'Users', // The name of the spreadsheet
  extraLength: 3 // A bigger number means that columns should be wider
}

var download = true // If true will download the xlsx file, otherwise will return a buffer

xlsx(columns, content, settings, download) // Will download the excel file

Examples

This are my files used for development, remember to change:

const xlsx = require('../index.js') || const xlsx = require('../index.js') => const xlsx = require('json-as-xlsx')

Released v1.1.0

22 Aug 21:40
Compare
Choose a tag to compare

json-as-xlsx

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

You can see a live example of how it works on this site: luisenmarroquin.github.io/json-as-xlsx

Usage

Just import and use it

var xlsx = require('json-as-xlsx')

var columns = [
  { label: 'Email', value: 'email' }, // Top level data
  { label: 'Age', value: row => (row.age + ' years') }, // Run functions
  { label: 'Password', value: row => (row.hidden ? row.hidden.password : '') }, // Deep props
]

var content = [
  { email: 'Ana', age: 16, hidden: { password: '11111111' } },
  { email: 'Luis', age: 19, hidden: { password: '12345678' } }
]

var settings = {
  sheetName: 'First sheet',
  fileName: 'Users',
  extraLength: 3 // Expands the sizes of the columns
}

var download = true // If true will download the xlsx file, otherwise will return a buffer

xlsx(columns, content, settings, download) // Will download the excel file

Examples

Released v1.0.9

22 Aug 21:34
Compare
Choose a tag to compare

json-as-xlsx

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

You can see a live example of how it works on this site: luisenmarroquin.github.io/json-as-xlsx

Usage

Just import and use it

var xlsx = require('json-as-xlsx')

var columns = [
  { label: 'Email', value: 'email' }, // Top level data
  { label: 'Age', value: row => (row.age + ' years') }, // Run functions
  { label: 'Password', value: row => (row.hidden ? row.hidden.password : '') }, // Deep props
]

var content = [
  { email: 'Ana', age: 16, hidden: { password: '11111111' } },
  { email: 'Luis', age: 19, hidden: { password: '12345678' } }
]

var settings = {
  sheetName: 'First sheet',
  fileName: 'Users',
  extraLength: 3
}

xlsx(columns, content, settings) // Will download the excel file

You can also see it being used with Vue 3 here

Released v1.1.5

23 Sep 16:36
Compare
Choose a tag to compare

json-as-xlsx

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

You can see a live example of how it works on this site: luisenmarroquin.github.io/json-as-xlsx

Usage

Just import and use it

var xlsx = require('json-as-xlsx')

var columns = [
  { label: 'Email', value: 'email' }, // Top level data
  { label: 'Age', value: row => (row.age + ' years') }, // Run functions
  { label: 'Password', value: row => (row.hidden ? row.hidden.password : '') }, // Deep props
]

var content = [
  { email: 'Ana', age: 16, hidden: { password: '11111111' } },
  { email: 'Luis', age: 19, hidden: { password: '12345678' } }
]

var settings = {
  sheetName: 'First sheet', // The name of the sheet
  fileName: 'Users', // The name of the spreadsheet
  extraLength: 3 // A bigger number means that columns should be wider
}

var download = true // If true will download the xlsx file, otherwise will return a buffer

xlsx(columns, content, settings, download) // Will download the excel file

Examples

This are my files used for development, remember to change:

require('./index.js') and require('../index.js') to require('json-as-xlsx')