Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
regexp replacements on returns, pattern example and added docs
- Loading branch information
Edward Hotchkiss
committed
Nov 30, 2011
1 parent
aafa81d
commit 291235c
Showing
4 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
/* | ||
pattern/replace `version` example | ||
fetch current version of express, and use a RegExp with | ||
a string to search/replace the version before returning it | ||
*/ | ||
|
||
var version = require('version'); | ||
|
||
version.fetch('express', { from : /^/gi, to : "v" }, function(error, version) { | ||
if (error) { | ||
console.error(error); | ||
} else { | ||
console.log('express current version with formating:', version); | ||
}; | ||
}); | ||
|
||
/* EOF */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters