Comparing version 1.0.0 to 1.0.1
10
doxli.js
@@ -9,4 +9,7 @@ var util = require('util'); | ||
var comment = djs.filter(function (i) { | ||
return i.ctx.name === name; | ||
return (i.ctx && i.ctx.name === name); | ||
})[0]; | ||
if (!comment) { | ||
return console.log("Sorry, no dox comments for " + name); | ||
} | ||
var tags = comment.tags; | ||
@@ -50,3 +53,6 @@ var desc = comment.description.full; | ||
module.exports = function (file) { | ||
var obj = require(file); | ||
console.log("doxlify " + __dirname + file); | ||
var path = require.resolve(file); | ||
console.log("doxlifying " + path); | ||
var obj = require(path); | ||
djs = dox.parseComments(fs.readFileSync(file).toString()); | ||
@@ -53,0 +59,0 @@ for (var x in obj) { |
{ | ||
"name": "doxli", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Get dox documentation for modules on the command line.", | ||
@@ -5,0 +5,0 @@ "main": "doxli.js", |
doxli | ||
===== | ||
Interactive help from [dox](https://github.com/visionmedia/dox) when using Node.JS modules on the command line. | ||
Interactive help documentation (using [dox](https://github.com/visionmedia/dox)) for Node.JS modules on the command line. | ||
When using Node.JS modules on the command line, doxli adds a | ||
```help``` command to a module's exports, so you can fetch dox | ||
/ jsdoc usage details. | ||
```help``` command to a module's exports, so you can view dox | ||
/ jsdoc documentation for its exported functions. | ||
@@ -19,3 +19,8 @@ Usage | ||
> doxli('./foo.js'); | ||
``` | ||
Module ```foo```'s exported methods now have a ```help``` utility! | ||
``` | ||
> foo.bar.help(); | ||
// => dox / jsdoc comments for this function will be printed here | ||
``` | ||
@@ -22,0 +27,0 @@ |
@@ -36,3 +36,2 @@ var doxli = require('../doxli'); | ||
exports.countfoo = function (foostring, barstring) { | ||
foostring = foostring || ""; | ||
return foostring.match(/foo/g).length; | ||
@@ -39,0 +38,0 @@ }; |
@@ -34,3 +34,3 @@ /** | ||
exports.countfoo = function (foostring, barstring) { | ||
return foostring ? foostring.match(/foo/g).length : 0; | ||
return foostring.match(/foo/g).length; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4631
128
35
3