---
title: "Node Packing Made Easy With Grunt"
description: "Publish node packages with npm is easier done than said! ;) First of all check out Hitchhikers guide to npm After which."
url: "https://h3manth.com/scribe/node-packing-made-easy-grunt/"
canonical_url: "https://h3manth.com/scribe/node-packing-made-easy-grunt/"
markdown_url: "https://h3manth.com/scribe/blog/node-packing-made-easy-grunt.md"
publishDate: "2012-10-30T00:00:00.000Z"
author: "Hemanth HM"
category: "javascript"
tags: ["nodejs","git","bash","web"]
word_count: 369
reading_time_minutes: 2
x_markdown_tokens: 792
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# Node Packing Made Easy With Grunt

> Publish node packages with npm is easier done than said! ;) First of all check out Hitchhikers guide to npm After which.

Publish node packages with npm is easier done than said! ;) First of all check out [Hitchhikers guide to npm](http://www.h3manth.com/node/349)

After which, install grunt! `npm install -g grunt` and then the fun begins.

**Below is a simple example of how to publish node packages with grunt+npm :**

```bash

$ mkdir test # Replace it with your package name.

$ grunt init:node Running "init:node" (init) task This task will create one or more files in the current directory, based on the environment and the answers to a few questions. Note that answering "?" to any question will show question-specific help and answering "none" to most questions will leave its value blank.

"node" template notes: Project name shouldn't contain "node" or "js" and should be a unique ID not already in use at search.npmjs.org.

Please answer the following: [?] Project name (test) [?] Description (The best project ever.) [?] Version (0.1.0) [?] Project git repository (git://github.com/hemanth/test.git) [?] Project homepage (https://github.com/hemanth/test) [?] Project issues tracker (https://github.com/hemanth/test/issues) [?] Licenses (MIT) [?] Author name (Hemanth.HM) [?] Author email (hemanth.hm@gmail.com) [?] Author url (none) h3manth.com [?] What versions of node does it run on? (>= 0.6.0) [?] Main module/entry point (lib/test) [?] Npm test command (grunt test) [?] Do you need to make any changes to the above before continuing? (y/N) n

Writing .npmignore...OK Writing grunt.js...OK Writing lib/test.js...OK Writing README.md...OK Writing test/test_test.js...OK Writing LICENSE-MIT...OK

Initialized from template "node".

$ tree . ├── LICENSE-MIT ├── README.md ├── grunt.js ├── lib │ └── test.js ├── npm-debug.log ├── package.json └── test
    
    
    └── test_test.js
    

2 directories, 7 files

$ npm publish #Ofcourse, after editing the boiler code as per need. ```

_WISH :_ Debian packaging was as easy as this!

_Built-in tasks_ As of now, grunt has the following predefined tasks that you can use in your project:

  * [concat](/new/gruntjs/grunt/blob/master/docs/task_concat.md) \- Concatenate files.
  * [init](/new/gruntjs/grunt/blob/master/docs/task_init.md) \- Generate project scaffolding from a predefined template.
  * [lint](/new/gruntjs/grunt/blob/master/docs/task_lint.md) \- Validate files with [JSHint][jshint].
  * [min](/new/gruntjs/grunt/blob/master/docs/task_min.md) \- Minify files with [UglifyJS][uglify].
  * [qunit](/new/gruntjs/grunt/blob/master/docs/task_qunit.md) \- Run [QUnit][qunit] unit tests in a headless [PhantomJS][phantom] instance.
  * [server](/new/gruntjs/grunt/blob/master/docs/task_server.md) \- Start a static web server.
  * test - Run unit tests with [nodeunit][nodeunit].
  * watch - Run predefined tasks whenever watched files change.

Happy Hacking! :)
```
