task runner) current stable version: 0.4.1 “task-based command line build tool for JavaScript projects that makes performing repetitive but necessary tasks trivial”
adds module to package.json as dev dependency grunt modules are installed in 'node_modules/' directory n p m i n s t a l l n p m i n s t a l l { { P A C K A G E _ N A M E } } - - s a v e - d e v g r u n t g r u n t { { T A S K } } g r u n t { { T A S K } } : { { T A R G E T } }
" m y - p r o j e c t " , " v e r s i o n " : " 0 . 1 . 0 " , " d e v D e p e n d e n c i e s " : { " g r u n t " : " ~ 0 . 4 . 1 " , " g r u n t - c o n t r i b - j s h i n t " : " ~ 0 . 4 . 3 " } }
(Gruntfile.js) n p m i n s t a l l g r u n t - c o n t r i b - j s h i n t - - s a v e - d e v g r u n t . l o a d N p m T a s k s ( ' g r u n t - c o n t r i b - j s h i n t ' ) ;
is optional g r u n t . i n i t C o n f i g ( { j s h i n t : { . . . } } ) ; g r u n t . r e g i s t e r T a s k ( ' d e f a u l t ' , [ ' j s h i n t ' ] ) ;
x p o r t s = f u n c t i o n ( g r u n t ) { / / P r o j e c t c o n f i g u r a t i o n . g r u n t . i n i t C o n f i g ( { p k g : g r u n t . f i l e . r e a d J S O N ( ' p a c k a g e . j s o n ' ) , j s h i n t : { . . . } } ) ; / / L o a d t h e " j s h i n t " t a s k . g r u n t . l o a d N p m T a s k s ( ' g r u n t - c o n t r i b - j s h i n t ' ) ; / / R e g i s t e r t a s k ( s ) . g r u n t . r e g i s t e r T a s k ( ' d e f a u l t ' , [ ' j s h i n t ' ] ) ; } ;