Comments (6)
Hey @coston , yeah, looks like it works now
from json-to-csv-export.
Hey @Vladichik, is this row of column indexes in your data? Please share the json you are using.
from json-to-csv-export.
Hello @coston my json does not contain indexes row.
Please see an example of one of my JSONs
[ [ "DATE", "WIDGET SEEN", "ENGAGEMENT", "CONVERSION", "SUBSCRIPTIONS", "WIDGET START", "EFFECTIVE CTR", "COMPLETION RATE", "ADDED TIME" ], [ "Sep 12, 2022", 170, 98, 0, 0, 36, 0.21176470588235294, 0.3611111111111111, "0:0min" ], [ "Sep 11, 2022", 184, 46, 0, 0, 36, 0.1956521739130435, 0.16666666666666666, "0:0min" ], [ "Sep 10, 2022", 372, 92, 0, 1, 59, 0.1586021505376344, 0.3050847457627119, "0:0min" ], [ "Sep 9, 2022", 334, 71, 0, 0, 56, 0.16766467065868262, 0.32142857142857145, "0:0min" ], [ "Sep 8, 2022", 268, 53, 0, 0, 50, 0.1865671641791045, 0.5, "0:0min" ], [ "Sep 7, 2022", 663, 240, 0, 0, 215, 0.32428355957767724, 0.25116279069767444, "12:19:24h" ], [ "Sep 6, 2022", 26176, 11733, 0, 1, 11715, 0.4475473716381418, 0.22185232607767819, "5:21:0h" ] ]
from json-to-csv-export.
Cool! Thank you for that JSON sample, @Vladichik. Currently, this lib only supports an array of objects. I will add my feature feedback to your PR.
from json-to-csv-export.
Hey @coston thanks for the update.
I've installed the new version of the lib which you've released yesterday.
But it throws me this exception:
SyntaxError: Unexpected token 'export' at wrapSafe (internal/modules/cjs/loader.js:1001:16) at Module._compile (internal/modules/cjs/loader.js:1049:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:101:18) at Object.json-to-csv-export (/app/.next/server/pages/_app.js:1805:18) at __webpack_require__ (/app/.next/server/webpack-runtime.js:33:42) at eval (webpack-internal:///./components/GenericTable/ExportToCsvButton.tsx:12:76) { page: '/' } /app/node_modules/json-to-csv-export/dist/index.js:34 export default csvDownload; ^^^^^^^^
I use the same typescript target es2015, and node version 16.
If I change function export to this:
export { csvDownload };
instead of this
export default csvDownload;
everything works fine
from json-to-csv-export.
@Vladichik thanks for the callout. The new tsconfig was not configured properly. I'm now outputting both esm and cjs. Would you mind trying again [email protected]
?
from json-to-csv-export.
Related Issues (12)
- rewrite code in TS HOT 1
- File not showing zeros HOT 1
- Reading undefined "reduced"
- Issue in export Hebrew text - add UTF-8 BOM to CSV export HOT 4
- Action required: Greenkeeper could not be activated 🚨
- doesn't work when strings contain double-quotation marks HOT 5
- Adding sep= to the top of file to help with opening csv files HOT 2
- Declare headers and data together
- `headers` order isn't respected when `data` is an array of objects
- Action required: Greenkeeper could not be activated 🚨
- Use comma as default separator to comply with RFC-4180
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-to-csv-export.