How can I completely uninstall and then reinstall Meteor.js?

Let’s start with the deletions, then we’ll move on to the reinstallations. If you ever installed Meteorite, uninstall and delete it: sudo mrt uninstall sudo mrt uninstall –system rm -rf ~/.meteorite Then delete Meteor: sudo rm /usr/local/bin/meteor rm -rf ~/.meteor Now start over at the beginning: Repair permissions if necessary: sudo chown -R $(whoami) ~/.npm … Read more

how to show all package dependency tree

While we’re waiting for the official tools to have this functionality, here’s the uglyslow vershion: for p in `meteor list | grep ‘^[a-z]’ | awk ‘{ print $1″@”$2 }’`; do echo “$p”; meteor show “$p” | grep -E ‘^ [a-z]’; echo; done This will show the dependencies of all added packages. It parses the output … Read more

Callback after the DOM was updated in Meteor.js

A hacky way to do it is: foo.html <template name=”mytemplate”> <div id=”my-magic-div”> .. stuff goes here .. {{add_my_special_behavior}} </div> </template> foo.js Template.mytemplate.add_my_special_behavior = function () { Meteor.defer(function () { // find #my-magic-div in the DOM // do stuff to it }); // return nothing }; The function will get called whenever the template is rendered … Read more

Importing a JSON file in Meteor

There are three ways you can go about this, it depends what you’re most comfortable with & your use case. The first is to store it as a JS Object if your json data is { “name”:”bob” } you could use myjson = {“name”:”bob”} in a .js file in the /lib folder and just call … Read more

Can Meteor live changes have animations?

Here is a working example of a simple animation with meteor. The situation here is that we have a list of items. If the user clicks on any of those items the item will animate 20px to the left. JS //myItem Template.myItem.rendered = function(){ var instance = this; if(Session.get(“selected_item”) === this.data._id){ Meteor.defer(function() { $(instance.firstNode).addClass(“selected”); //use … Read more