Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

donskifarrell/meteor-jquery-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is no longer maintained!

Sorry, time constraints have stopped from keeping track of this package. I recommend you look for alternatives on atmospherejs.

JQuery CSV for Meteor

Parse CSV (Comma Separated Values) to Javascript arrays or dictionaries

Note: The JQuery-CSV.js file has been slightly modified from the official released version. This was to add in a 'headerIndex' option to the toObjects(..) method.

Scope

I am using this library for client side parsing of CSV files. If you are looking for server-side parsing, more complete NPM solutions can be found here.

Syntax (taken from the JQuery CSV page)

Importing

Client-Side: (ie. browser) - import via the script element.

<script src="jquery-csv.js"></ script>

Server-Side: (ie. Node.js) - Import via the standard CommonJS approach.

var $ = jQuery = require('jquery');
require('./jquery.csv.js');

Usage

A basic usage example can be found here.

Each one of the JQuery-CSV methods can be called with the following form:

$.csv.function(csv, {options}, callback);

csv (required) - The csv data to be transformed.

options (optional) - An object containing user-defined overrides for the default options.

callback (optional) - Used for Node.js-style async callbacks. Uses the form function(err, data).

Methods

toArray

Parse a single entry string to an array

$.csv.toArray(csv);

toArrays

Parse a multi-line CSV string to a 2D array

$.csv.toArrays(csv);

toObjects

Parse a multi-line CSV string to an array of objects

$.csv.toObjects(csv);

Requirements

  • NPM

How do I install this?

  1. Install Meteorite: npm install -g meteorite
  2. Create your project: mrt create mynewapp
  3. Add jquery-csv: mrt add jquery-csv

References

Meteor

Meteorite

Atmosphere (Smart Packages)

JQuery CSV Homepage

JQuery CSV API

Thanks to AdaptiveLab for the smart package template

About

Parse CSV (Comma Separated Values) to Javascript arrays or dictionaries

Resources

Stars

Watchers

Forks

Packages

No packages published