[Pkg-javascript-commits] [node-detective] 49/119: upgrade readme
Bastien Roucariès
rouca at moszumanska.debian.org
Wed Sep 6 09:44:34 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-detective.
commit d3b2da5b78797f2235956914a707dd093fca6f47
Author: James Halliday <mail at substack.net>
Date: Fri Mar 1 17:15:16 2013 -0800
upgrade readme
---
README.markdown => readme.markdown | 54 ++++++++++++++++++++------------------
1 file changed, 29 insertions(+), 25 deletions(-)
diff --git a/README.markdown b/readme.markdown
similarity index 62%
rename from README.markdown
rename to readme.markdown
index ed42b47..a3c823d 100644
--- a/README.markdown
+++ b/readme.markdown
@@ -1,56 +1,53 @@
-detective
-=========
+# detective
-Find all calls to require() no matter how crazily nested using a proper walk of
-the AST.
+find all calls to `require()` by walking the AST
[![build status](https://secure.travis-ci.org/substack/node-detective.png)](http://travis-ci.org/substack/node-detective)
-example
-=======
+# example
-strings
--------
+## strings
strings_src.js:
-````javascript
+``` js
var a = require('a');
var b = require('b');
var c = require('c');
-````
+```
strings.js:
-````javascript
+``` js
var detective = require('detective');
var fs = require('fs');
var src = fs.readFileSync(__dirname + '/strings_src.js');
var requires = detective(src);
console.dir(requires);
-````
+```
output:
- $ node examples/strings.js
- [ 'a', 'b', 'c' ]
+```
+$ node examples/strings.js
+[ 'a', 'b', 'c' ]
+```
-methods
-=======
+# methods
+``` js
var detective = require('detective');
+```
-detective(src, opts)
---------------------
+## detective(src, opts)
-Give some source body `src`, return an array of all the require()s with string
-arguments.
+Give some source body `src`, return an array of all the `require()` calls with
+string arguments.
The options parameter `opts` is passed along to `detective.find()`.
-detective.find(src, opts)
--------------------------
+## detective.find(src, opts)
Give some source body `src`, return an object with "strings" and "expressions"
arrays for each of the require() calls.
@@ -60,7 +57,14 @@ The "expressions" array will contain the stringified expressions.
Optionally you can specify a different function besides `"require"` to analyze
with `opts.word`.
-installation
-============
+# install
- npm install detective
+With [npm](https://npmjs.org) do:
+
+```
+npm install detective
+```
+
+# license
+
+MIT
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-detective.git
More information about the Pkg-javascript-commits
mailing list