A full Grunt config for your Node.JS server in TypeScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
Gruntfile.js Forgot gruntfile Jan 15, 2015
README.md Update README.md Jan 24, 2015
package.json
server.ts Added specific files Jan 15, 2015
tsd.json
tslint.json

README.md

grunt-nodejs-typescript

A powerful Grunt configuration that can lint and compile your TypeScript files and restart your node server each time you make a change to your code.

Here is the full article explaining step by step the making of this config: http://geeklearning.io/grunt-configuration-for-your-nodejs-server-in-typescript/

##Prerequesities

If you haven’t done it yet, to be able to run Grunt, you’ll have to first install Node.js. Then, install the Grunt CLI using npm (installed with NodeJS) by running this command:

npm install –g grunt-cli

You need TypeScript on your machine: ``` npm install –g typescript ```
Typescript is a typed language. It needs definitions files for the libraries you're using to be able to do it's work. There is an [opensource repository](http://definitelytyped.org/) full of TypeScript definitions for known libraries. Meaning someone has already done the job for us! There's a [manager]((http://www.tsdpm.com)) using this repository to make our work even simpler. So don't forget to install it: ``` npm install –g tsd@next ```
This configuration use [nodemon](https://github.com/remy/nodemon) to handle the node server. So you need to install it: ``` npm install -g nodemon ```

##Installation

Install necesseray npm packages:

npm install

Install necessary TypeScript definitions files:

tsd reinstall -s

##Commands

grunt

Will lint and compile your TypeScript files.


``` grunt serve ``` Will watch for changes in your code. When it detects a change, it lints the moddified file, compile the project and restart the node server.