Permalink
Browse files

synchronous example

  • Loading branch information...
1 parent e1a9809 commit 3534992946294811d20aaf9857ee453078cbe828 @substack committed Feb 19, 2013
Showing with 23 additions and 0 deletions.
  1. +3 −0 example/sync.js
  2. +20 −0 readme.markdown
View
@@ -0,0 +1,3 @@
+var resolve = require('../');
+var res = resolve.sync('tap', { basedir: __dirname });
+console.log(res);
View
@@ -9,6 +9,8 @@ synchronously
# example
+asynchronously resolve:
+
``` js
var resolve = require('resolve');
resolve('tap', { basedir: __dirname }, function (err, res) {
@@ -17,6 +19,24 @@ resolve('tap', { basedir: __dirname }, function (err, res) {
});
```
+```
+$ node example/async.js
+/home/substack/projects/node-resolve/node_modules/tap/lib/main.js
+```
+
+synchronously resolve:
+
+``` js
+var resolve = require('resolve');
+var res = resolve.sync('tap', { basedir: __dirname });
+console.log(res);
+```
+
+```
+$ node example/sync.js
+/home/substack/projects/node-resolve/node_modules/tap/lib/main.js
+```
+
# methods
``` js

0 comments on commit 3534992

Please sign in to comment.