digplan / json2xlsx Goto Github PK
View Code? Open in Web Editor NEWPipe JSON to Excel spreadsheet
Pipe JSON to Excel spreadsheet
IS there a way to set the locale of the file? In hungary we use "," instead of "." for the decimal but when I export I get a file where all of them are "." separated
When trying to install the package from the npm registry I'm getting this error:
404 https://registry.npmjs.org/json2xlsx/-/json2xlsx-0.1.4.tgz
npm ERR! fetch failed https://registry.npmjs.org/json2xlsx/-/json2xlsx-0.1.4.tgz
npm ERR! Error: 404 Not Found
(local install is working all fine.)
btw awesome package; I'd like to use it in a project, but there is no license. It could help to add that.
The goal is to stream json from a database into an excel sheet, however, the script doesn't update the file via a node script, it simply wipes the file and writes in the new data.
var json2xlsx = require('json2xlsx'),
json = [
{ name: 'bill', cash: 400 },
{ name: 'jill', cash: 382 },
{ name: 'will', cash: 904 },
{ name: 'phil', cash: 104 }
],
json2 = {
worksheet1: [
{name: 'gill', cash: 765}
]
};
json2xlsx.write('test.xls', 'worksheet1:', json);
json2xlsx.write('test.xls', 'worksheet1:', json2);
json2xlsx.read('test.xls');
The output is this:
{ 'worksheet1:':
{ '!ref': 'A1:B2',
A1: { t: 's', v: 'name', h: 'name', w: 'name' },
B1: { t: 's', v: 'cash', h: 'cash', w: 'cash' },
A2: { t: 's', v: 'gill', h: 'gill', w: 'gill' },
B2: { t: 'n', v: 765, w: '765' } } }
I am expecting this:
{ 'worksheet1:':
{ '!ref': 'A1:B2',
A1: { t: 's', v: 'name', h: 'name', w: 'name' },
B1: { t: 's', v: 'cash', h: 'cash', w: 'cash' },
A2: { t: 's', v: 'bill', h: 'bill', w: 'bill' },
B2: { t: 'n', v: 400, w: '400' },
A3: { t: 's', v: 'jill', h: 'jill', w: 'jill' },
B3: { t: 'n', v: 382, w: '382' },
A4: { t: 's', v: 'will', h: 'will', w: 'will' },
B4: { t: 'n', v: 904, w: '904' },
A5: { t: 's', v: 'phil', h: 'phil', w: 'phil' },
B5: { t: 'n', v: 104, w: '104' },
A6: { t: 's', v: 'gill', h: 'gill', w: 'gill' },
B6: { t: 'n', v: 765, w: '765' } } }
Hi,
In my case, I have data of the length 46. and when I run json2xlsx.write and check the data in excel it appends another row. (A, B,C,D) in my case. Making my data length to 47.
Kindly follow up on this issue asap
Thanks
the name json2xlsx is not taken, so you can publish it.
Also, I Think you can make a script that installs to path. It would be nice to . For example, the xlsx module adds a script https://github.com/SheetJS/js-xlsx/blob/master/bin/xlsx.njs
The ideal circumstance would be something like get_data | json2xlsx > out.xlsx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.