GithubHelp home page GithubHelp logo

meteor-excel's Introduction

meteor-excel

Mainly this package is a wrap for the npm packages listed above. So checkout their documentation to see how to work with excel files properly.

Parsing and generating excel files (xlsx, xls).

This package uses the npm packages:

Getting Started

There is nothing like a good example to get started with this package. Check out this MeteorPad for an exportable leaderboard to excel file. Follow the comments in the meteorpad, mainly in the server/app.js file.

Three steps to use it (basic cover)

1.- GET YOU APP PATH..

var fs = Npm.require('fs');
var path = Npm.require('path');
var basepath = path.resolve('.').split('.meteor')[0];

2.- CREATE A NEW EXCEL OBJECT

___ This package exports the Excel object to the server. Meaning this package is currently available only to the server side.___

To work with excel files first create an Excel object matching the excel file type you want to handle: xlsx/xls. To do that just use:

var excel = new Excel('xls');

or

var excel = new Excel('xlsx');

3.- READING XLS/X

  • Read a file
var workbook = excel.readFile( basepath+'yourFilesFoler/someExcelFile.xls'); 
  • Get the SheetNames (this is important to use most of the functions)
var yourSheetsName = workbook.SheetNames;
  • Get a cell
console.log("Get the 1st Sheet Name (remember is an array): " + workbook.SheetNames[0]);
console.log("Get Some Cell from it: " + workbook.Sheets[yourSheetsName[0]][
'C37'].v);
  • Make a JSON out of your excel
var workbookJson = excel.utils.sheet_to_json(workbook.Sheets[yourSheetsName[0]]);
console.log("Get the length: " + workbookJson.length);
  • Make a CSV out of your excel
var workbookCsv = excel.utils.sheet_to_csv(workbook.Sheets[yourSheetsName[0]]);
console.log(workbookCsv.length);

Contribute

Used this package? got an example to show? conact me or PR the README and i'll happly add it :)

meteor-excel's People

Contributors

netanelgilad avatar cristiandley avatar

Watchers

James Cloos avatar Henrik Grönvall avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.