If your product set is small, you can get it all in one file and remove the parsing.
var products = [{}, {), ...];
if (Products.find().count() === 0) {
products.forEach(function (product) {
Products.insert(product);
});
}
OR
With the new import in Meteor 1.3, you can import them instead, for example.
export default [{}, {), ...];
import products from './products.js';
if (Products.find().count() === 0) {
products.forEach(function (product) {
Products.insert(product);
});
}
source
share