Last active
August 29, 2015 14:22
-
-
Save hamzamu/312d0f7582a526af310b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Asynchronous Method. | |
Meteor.startup(function () { | |
console.log('starting up'); | |
var fs = __meteor_bootstrap__.require('fs'); | |
fs.readFile('file.json', 'utf8', function (err, data) { | |
if (err) { | |
console.log('Error: ' + err); | |
return; | |
} | |
data = JSON.parse(data); | |
console.log(data); | |
}); | |
}); | |
// Synchronous Method. | |
Meteor.startup(function () { | |
var fs = __meteor_bootstrap__.require('fs'); | |
var data = fs.readFileSync('public/datafile/flare.json', 'utf8'); | |
if (Icd10.find().count() === 0) { | |
Icd10.insert({ | |
date: new Date(), | |
data: JSON.parse(data) | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment