egeriis / zipcelx

Turns JSON data into `.xlsx` files in the browser
MIT License
294 stars 90 forks source link

Add ability to add multiple sheets to a workbook #58

Closed elliotstoner closed 4 years ago

elliotstoner commented 5 years ago

There have been a few previous PRs for adding multi-sheet functionality - this is actually built off of davidryansoftware's fork, but with a few tweaks. I'd love feedback and suggestions, and hopefully we can finally get this merged in!

Some key things from feedback previously given:

Using the new sheets property, the config would look like:

const config = {
    filename: 'Test',
    sheets: [
        {
            sheetname: 'Test Sheet 1',
            data: [
                [{
                    value: 'Sheet 1 Value',
                    type: 'string'
                }, {
                    value: 1234,
                    type: 'number'
                }]
            ]
        },
        {
            data: [
                [{
                    value: 'Sheet 2 Value',
                    type: 'string'
                }, {
                    value: 9876,
                    type: 'number'
                }]
            ]
        }
    ]
};
ghost commented 5 years ago

@elliotstoner Nice Work. I actually agree that sheets should be an array, The code I was working with at the time I created the fork was expecting an object.

elliotstoner commented 5 years ago

Just thought of this - if we like this approach, do we want to have the goal of ultimately getting rid of sheet in favor of sheets in a future major release? If so, do we want to introduce a deprecation warning for sheet now? I would also update the docs to reflect any decisions.

elliotstoner commented 4 years ago

Bump @egeriis. It's been almost 9 months - do we want to move forward with this or are we abandoning it? If the latter then I'm going to branch this off onto my own package

elliotstoner commented 4 years ago

This repo seems unmaintained. I'm going to close this pull request in favor of migrating to xljsx-lite! For anyone looking for this functionality, feel free to check out my repo with these improvements, with more to come! There's two versions: v1.0.2 is the closest to this current repo, while v2.0.0 has some additional improvements (automatic typing, even further reduced bundle size). I look forward to feedback about how we can improve this together!