Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

synchronous example

  • Loading branch information...
commit 3534992946294811d20aaf9857ee453078cbe828 1 parent e1a9809
@substack authored
Showing with 23 additions and 0 deletions.
  1. +3 −0  example/sync.js
  2. +20 −0 readme.markdown
View
3  example/sync.js
@@ -0,0 +1,3 @@
+var resolve = require('../');
+var res = resolve.sync('tap', { basedir: __dirname });
+console.log(res);
View
20 readme.markdown
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.