Warning: mysql_real_escape_string(): No such file or directory in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285

Warning: mysql_real_escape_string(): A link to the server could not be established in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285

Warning: mysql_real_escape_string(): No such file or directory in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285

Warning: mysql_real_escape_string(): A link to the server could not be established in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285

Warning: mysql_real_escape_string(): No such file or directory in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285

Warning: mysql_real_escape_string(): A link to the server could not be established in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285

Warning: mysql_real_escape_string(): No such file or directory in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285

Warning: mysql_real_escape_string(): A link to the server could not be established in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285

Warning: mysql_real_escape_string(): No such file or directory in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285

Warning: mysql_real_escape_string(): A link to the server could not be established in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285

Warning: mysql_real_escape_string(): No such file or directory in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285

Warning: mysql_real_escape_string(): A link to the server could not be established in /home/jostylr/mythiclogos.com/blog/wp-content/plugins/statsurfer/append.php on line 285
Working Out the Developer Flow | Mythic Logos
Skip to content

Working Out the Developer Flow

I like JavaScript. So that means I have chosen Node.js and MongoDB as my server language and database. After all, Node.js is JavaScript on the server and MongoDB uses JSON as its basic data format and also for its query objects.

Having just one language to work with is a complete joy. The browserify package allows me to use the same module system and even the same modules on the browser as on the server. The package query-engine allows me to use MongoDB query objects in my JavaScript code. And my eventingfunctions is an attempt to push the entire MongoDB object model into my flow.

So I have unity all along the coding front. But there is still the question of the workflow. I use TextMate. That is working for me. Fortunately, people write bundles for it which is what makes it very useful. With luck, that will continue to be the case.

I use git via GitHub, but mostly from a graphical client. I started with GitHub for Mac which was really easy to use. But I am currently liking GitBox as it is closer to the metal, as they say. I feel like I am seeing the command line commands and I do feel more comfortable with git command line. It also allows me to see the remote changes before I pull, which is a very nice feature.

Coding in node.js, I use NPM. Until recently, I was a basic consumer: npm install whatever. When I realized that I should extract a module from my project, I looked around for a way to do that. I tried git submodule. It seemed a reasonable idea. It met with failure. The general setup of node modules is npm now. But even more so, I find git itself to be a bit difficult at times and submodules seem to be at the difficult part. Removing them was complicated. I also was getting confused as to where to edit the submodules. Keeping the stand-alone clone up to date with the embedded one was a silly process.

I began to look again. And then I found it. npm has a command called link. Go to the directory of your stand-alone module and run npm link. This makes a symbolic link with the global install registry. In the project directory, now repeat link but with the module name. So if eventingfunctions is my module, I first do npm link in the eventingfunctions directory. Next, let’s say that the project is webapp. Then go to webapp’s root directory and type npm link eventingfunctions. In the node_module directory, eventingfunctions should appear. As you make changes in the stand-alone, they are instantly reflected in the linked directory; they are symbolic links, after all.

To set webapp to install all its dependencies with the single command, use npm install. This will only work with a package.json being present in the working directory. Use npm init to create a basic package.json and use npm help json to get some guidance on that file. Getting the versioning correct does require some guidance.

Having cleaned up that mess1, I am now quite pleased with npm as a way of managing not only published projects, but my own.

I also learned about global versus local installs in npm. The recommendation is that command line apps should be global npm install -g while modules used inside a project using reuire() should be installed locally. If doing both, install it both ways.

I did, however, have to modify one of the files in one of the npm projects. I am not sure the best way to handle it. I guess I will just write a script to run after an update to make the changes.

My next challenge is to get my blogs out of WordPress and into GitHub. I am pretty sure I will be using markdown for the blog entries (this is written in markdown) via pandoc and probably using json templates for a templating engine. My plan is to make a static site generator using those tool and then publish my blogs on GitHub Pages. For images, I am thinking I will put them on my DropBox account and link to them from there.

The choice of markdown is easy since it is simple to learn and consistently chosen in the node community as well as GitHub. The choice of json templates is harder as it has little community wide acceptance. However, having read the author’s thoughts on why, I tend to agree. Namely, it is declarative, minimal, and JSON. I like all of that. But we shall see.


  1. git mergetool helped after I deleted the submodules without first pulling other conflicting changes

{ 2 } Comments

  1. Thomas Park | January 2, 2012 at 11:27 am | Permalink

    Thanks for sharing the behind-the-scenes of your development. I’ll be interested to see how your blog migration goes. I know Jekyll/Octopress is de rigueur these days, but hadn’t heard of JSON Template.

  2. mythiclogos | January 3, 2012 at 9:26 pm | Permalink

    JSON Template is actually a couple of years old and I do not think it has gotten much traction. But it seems appealing to me. As for Jekyll, and all that, I looked into it, but I really just want something in JavaScript.

    Note: pandoc is written in Haskell! But I do not intend to muck around with that in contrast to templates.

Post a Comment

Your email is never published nor shared. Required fields are marked *