Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/danieljdufour/git-csv

The Easiest Way to Get the Rows from a CSV on Github
https://github.com/danieljdufour/git-csv

csv git github

Last synced: 22 days ago
JSON representation

The Easiest Way to Get the Rows from a CSV on Github

Awesome Lists containing this project

README

        

# git-csv
The Easiest Way to Get the Rows from a CSV on Github

# install
```bash
npm install git-csv
```

# usage
## Getting a CSV from a Public Repo
```javascript
const gitCSV = require('git-csv');

const rows = await gitCSV({
url: 'https://github.com/org/repo/blob/master/folder/example.csv'
});
// rows is like [ [ 5, 389, 'HARVARD UNIV', 'Ames Hall', true ], ...]
```

## Getting a CSV from a Private Repo
```javascript
const gitCSV = require('git-csv');

const rows = await gitCSV({
accessToken: '12ye7taslasudfbhkyjasvfjysdce621tcu6ertc12y5r',
url: https://github.com/org/repo/blob/master/folder/example.csv
});
```

## Getting a CSV with a Header
```javascript
const gitCSV = require('git-csv');

const rows = await gitCSV({
header: true,
url: https://github.com/org/repo/blob/master/folder/example.csv
});
// rows is like [ { team_name: 'Celtics', location: 'Boston' }, ...]
```