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 <mfncoo...@gmail.com> wrote: > On Sun, Jul 29, 2012 at 11:40 AM, Azer Koçulu <a...@kodfabrik.com> 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 nodejs@googlegroups.com >> To unsubscribe from this group, send email to >> nodejs+unsubscr...@googlegroups.com >> 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 nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > 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 nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en