Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

readme example, basic example in /examples/basic.js

  • Loading branch information...
commit aafa81dfc522a6b720bf63cebffbb7acdfc335cf 1 parent 9bf9a20
Edward Hotchkiss authored
Showing with 32 additions and 1 deletion.
  1. +14 −0 README.md
  2. +17 −0 examples/basic.js
  3. +1 −1  package.json
View
14 README.md
@@ -8,3 +8,17 @@
```bash
$ npm install version
```
+
+### Example (basic)
+
+```javascript
+var version = require('version');
+
+version.fetch('express', function(error, version) {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('express current version: ', version);
+ };
+});
+```
View
17 examples/basic.js
@@ -0,0 +1,17 @@
+
+/*
+ basic `version` example
+ fetch current version of express
+*/
+
+var version = require('version');
+
+version.fetch('express', function(error, version) {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('express current version:', version);
+ };
+});
+
+/* EOF */
View
2  package.json
@@ -2,7 +2,7 @@
"author": "Edward Hotchkiss <e@ingk.com>",
"name": "Version",
"description": "NodeJS package.json version number fetcher",
- "version": "0.0.1",
+ "version": "0.0.2",
"repository": {
"type": "git",
"url": "git://github.com/edwardhotchkiss/version.git"
Please sign in to comment.
Something went wrong with that request. Please try again.