Skip to content

ES2015 class refactor #38

Description

@Radiergummi

I've reworked zipcelx into a class since it fits better into our application workflow. Just leaving this here for reference in case this is useful to you.

Notably, the public API is split between analyze, build and download, the console calls are gone in favor of actual thrown errors and the lodash dependency was removed since it's really just a few lines of code that don't do anything special.
The workflow changes to the following:

import Spreadsheet from 'zipcelx';

try {
  const mySheet = new Spreadsheet( [ /* sheet data */ ] );
} catch ( error ) {
  console.error( `Could not create my sheet: ${error.message}` );
}

await mySheet.download( 'desired-filename-without-extension' );

console.log( 'file has been downloaded.' );

See the gist here.

Thank you for the library, it's coming in handy over here 😉

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions