I didn't know require is able to read JSON files, thanks for reply!

On Sun, Jul 29, 2012 at 11:47 AM, Martin Cooper <[email protected]> wrote:
> On Sun, Jul 29, 2012 at 11:40 AM, Azer Koçulu <[email protected]> wrote:
>> Hi all,
>>
>> I'm looking for a library to print out the current version of my
>> application
>
> You can just load your package.json using 'require' and get it from there:
>
> var pkg = require("./package.json");
> console.log('v' + pkg.version);
>
> --
> Martin Cooper
>
>
>>, like following;
>>
>> var currentVersion = require('current-version');
>>
>> currentVersion(function(error, v){
>>
>>   console.log( 'v'+ v);
>>
>> });
>>
>> Azer
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: 
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to