I’m writing down some of the things I’ve picked up when I started to learn about Node, Express, and Mongo. Here are all the posts in the series:
- Doing stuff in the terminal is not scary at all - this post
npm
is not only for getting packages- Package.json is a mighty tool
git
is not that hard, but I need to refresh my knowledge- Callback function is cool stuff, and I even know how to write them
mocha
is cool both as framework and test runnershould
is a nice way to do assertsmonk
is an easy way to access mongo- Express is best without generators
- supertest is a nice way to test an api
This post is about the terminal and how I got to use it more and more, with just a couple of simple commands.
I’m a Microsoft developer and am used to Visual Studio. Very nice, very integrated environment with shiny buttons, menus or key shortcuts to execute.
The terminal (yes, I’m on OS X - but embrace the CMD if you’re on Windows) windows was a lonely void space for me. But I’ve now embraced it. And after a while, I picked up a small number of commands that got me around.
This is what I do when I start a new node project:
clear
- to get rid of all the stuff in the window when I start. I like my terminal nice and clean.pwd
- to know which directory I’m in. And it has nothing to do with passwords, it’s “present working directory”.cd ~/Projects/NodeStuff
- to get to my Node directory in my Project-directory, where I’ve stored all the Node stuff.mkdir TheNewProject
- to create a new folder for “the new project”.cd TheNewProject
- to get into TheNewProject-directory.mkdir test
- to create a test directory.touch package.json
- to create a package.json file. See this post for more on that file and its awesome capabilities.sublime .
- to open the current directory with Sublime Text 2. You can of course open it in another editor too.
Until that point, I’ve only been in the terminal window. This takes me about 10 - 20 seconds to do, depending on how long it takes for me to find the “~” button on my keyboard (ALT+^ on Swedish keyboards, remember that Marcus!).
Oh yeah, I’m running the terminal in a window that covers the screen from top to bottom and about half the window in size. And I’m using the slick Pro-profile that gives it a nice transparent look.