Skip to content

Commit

Permalink
Merge pull request #411 from kriscarle/patch-1
Browse files Browse the repository at this point in the history
Update readme with a complete browser example
  • Loading branch information
dogabudak authored Jun 7, 2021
2 parents d23f4af + fddac08 commit 6720684
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,14 @@ If a module packager is preferred, just simply `require("csvtojson")`:
var csv=require("csvtojson");

// or with import
import * as csv from "csvtojson";
import {csv} from "csvtojson";

//then use csv as normal, you'll need to load the CSV first, this example is using Fetch https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
fetch('http://mywebsite.com/mycsvfile.csv')
.then(response => response.text())
.then(text => csv.fromString(text));
.then(function(result){

})

//then use csv as normal
```

0 comments on commit 6720684

Please sign in to comment.