Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mikepaszkiewicz/b172879773caaa9ee9f4ca8c512694f9 to your computer and use it in GitHub Desktop.
Save mikepaszkiewicz/b172879773caaa9ee9f4ca8c512694f9 to your computer and use it in GitHub Desktop.
Import CSV Module
Packages needed
- (json-2-csv)[https://www.npmjs.com/package/json-2-csv]
- (ddp)[https://www.npmjs.com/package/ddp]
1. Run command takes 3 arguments:
- Filename of CSV to read
- Meteor collection name
- DDP URL String (localhost:3001/meteor most likely...)
2. Read CSV from file system
3. Convert into JSON format (output err/success message)
4. Connect to local database (output err/success message)
5. DDP.call method that inserts Prospect into database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment