{"_id":"doctor","_rev":"91-53ad1b7a4a8e38baa428b1f3c2bc0f44","name":"doctor","description":"Create documentation from or otherwise analyze/transform JavaScript source.","dist-tags":{"latest":"0.3.0"},"versions":{"0.0.0":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.0.0","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"uglify-js":">= 1.1.1","optimist":">= 0.2.8","async":">= 0.1.9"},"devDependencies":{},"bin":{"doctor":"bin/doctor"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.0.0","_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"decd7ffeb31accacaf23df8c0fcc7ce32007ca9f","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.0.0.tgz","integrity":"sha512-bKZf0qX1x1INTGe/VadmkL23KFlHvDlCBgbi3GXuvpqhXYC5CKtQOFPerQ+fM0HMS53CQH6Gf2Xe04Pzz69/LQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzRtBXMpLGLXKIHzCd4ilSXVwX8yXvn57CvIO0zW+JLgIgRHDG4nxzPRx8o9+FgM0SNIByxzm12x/3k/smbHPNuR8="}]},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.0.1":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.0.1","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2"},"devDependencies":{},"bin":{"doctor":"bin/doctor"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.0.1","_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"99a890c4b86ca52cd0deb2eb0e36dbebac80d00b","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.0.1.tgz","integrity":"sha512-FGJ+SB/qWY/yWPcME0KnVTec+zqylnGzqRseBYw+T0U4WE+DbVANhKHyXDCTBdhcvwAGatQrMdi8GTeryh4jNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICBj+vlY9dYXgs/RePuCReZEecPcZ1hd+bsLtmHH8DNCAiA2wDeeo2flx7fhq/yBQLzXqHR06PgSMjtY85qIZqAeVg=="}]},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.0.2":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.0.2","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.2"},"devDependencies":{},"bin":{"doctor":"bin/doctor"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.0.2","_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"7b6f617f1c78370f943eb1f2a6c3762d23e119e8","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.0.2.tgz","integrity":"sha512-tsJ1J4z8aZoSEAgOGx1mu/IutVGTZLey+JxX+QDDbp6ke8R2NLb1mVM6EVdLFNK/okNKC8OXDZthLAeYl30bSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrzyAqLYKKsDlJMBxS+I/iiE4JPt1w/Ut/0O2PCKDeaAIhAIK7yFSJHqyOPgtS7DPSJ6mzXDQuyG5HUFCDHVxMrX20"}]},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.0":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.0","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.0","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"1837cb4545f11838333da11ea2287788ddef7c1b","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.0.tgz","integrity":"sha512-Z0jInK2QYRy7g7c4Ho4qyKyLon2lB+4y2/W2/4vfuSlPCf5uDf+pDtpz/Gh8tCxExDh2Ct7Ynkjmq2sWFEjeCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC084AHV7vWFlzd67513olUnYowEzO+iGxUeyiI4NSaswIhAMK1O2yPtT4qQkPL6dNLv7EQx8PwFCpmEhI0VmNQdTUN"}]},"readme":"# doctor\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n\n## Misc\n\nTo serve dynamically generated documentation:\n\n```\ncp output/report.json view\nnode lib/server.js\nopen http://localhost:3000\n```\n\nTo automatically generate doc.css when doc.scss is modified:\n\n```\ncd view\nsass --watch .:.\n```\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.1":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.1","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.1","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"69d7ad54a735b4b43c6c2127c77545d87f12e1b5","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.1.tgz","integrity":"sha512-bc20Cq+rYwfqbPKtt2zmu0OpN83vgHMM0ONcpSj8x2sDYz/gdtom7x+WrGWFhh4AKNSxx5/peVkAz7cBdNa1SA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCt7Yad3/+XbMvO2NX3Vvv1JwCzUdADa7FoEYOJqkWW2gIgCPYH4ekjpyOMAvFhPZZdK911BSPEwNjniiTeW0b4PrI="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.2":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.2","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.2","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"f6e043b17e83bd7ba066c94b09d4dfb963c7da88","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.2.tgz","integrity":"sha512-uq6JxDro0HRaolwDH//Ky0E1uSLCodvjlZXU/ihSm3fv/m+qJsuIsYz/cCrsD/C4t6IM1mSzdegGvbqIrW/gSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlfWYu1kIMCeTs7S9p4FldXQDe/BRlxjbkTQviaqBGkwIgOmkC8aJiWJSHNdFTsu1X/frH+GZOcC4WB8F3ymq/Grs="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.3":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.3","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.3","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"f201a560e11c966f3b7f0e6b0be024c08dc847c0","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.3.tgz","integrity":"sha512-S0AuPeva3d6M+RLGFJjdzELMg+qH39TehVvDNRdpdmrnkL6G2aIGJMiwoxlcUANvBixIgiKhvsiyGt41N8eMGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGVdv/2t/NUwgmv1JFUar0LMzEZ3b1kMkboxkueIRU/tAiBUJgMGOg85D3mlfhMHgrj1M9HFwh2/3lssGn9w5+8Z0A=="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.4":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.4","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.4","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"08244c9d3c8217a5c046307314437357cd96b979","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.4.tgz","integrity":"sha512-4BXN3wc+IJNPIfhbK4c1OgcFrokiUga68FobLQaAq/wVlHnybQGa1G7sHoQ1hyMP0y09Lh9ncTUw3EsjrQR/PA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaZA11Zc0mvDlpk/KyoQYKmsOJGSYxK+gLT0TrEpOpVwIgB6kXfYgh5zzALKe5jByYVZcsZCFMejqsfLt5CDMQuR0="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.5":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.5","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.5","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"198c1c1bc0178664377950b285599ad4ef8aa0ce","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.5.tgz","integrity":"sha512-SyU87CX/ckDsIPqYSJUIuSoWxdQjMUfl5m4Kx3b5k6Tw6tG1RANexSnSq9MTe2lZ6PCAkyHQw+TFQ4Nj9hFq2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDxao2MTOiCcbuKQ7zHN1iyTBKhdRwUZuTL1XJ3rjTsAIgNflgU1jj0VXLJBJDWeAZf4HaE7eym3+KcozXM8mVV2w="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.6":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.6","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.6","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"18c028c9c8a48bddad961f744f27f07cc780fd27","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.6.tgz","integrity":"sha512-mWsYYYzaH01bCoe3t++Ue19mFesZ6+jTXVKn+WOOGL/II2m66oIRAEb7R44TCRw5NRu96tZvqFE/UO9JS6yc3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICClvaWqxl7LP3Ruc7CJDaKYiiuRlckbwLBWEQ9pIQkNAiEAvbJ1Hq9iIAa59r8xsS1QH3OcoVp5nF83B74VpDegPEI="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.7":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.7","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.7","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"6c9aba58a943cfb1381912c2ac77724da240a041","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.7.tgz","integrity":"sha512-HNF7XDDWdjhKTIRCPM5kl1HOgU0eBuGkVQKB69hZekWohGAXL8A6MzsP7bv48LAD+QpXOZnQHbdKz/7cBw28kw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBuLFQjRvS9V0HGRT+VlJpP5sGJGDRfSIHGHqF1m8S9XAiBMeW7rS1C+VY95EkNfkj4EuQp9GYg/Zw4XjQJIUBbeRQ=="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.8":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.8","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.8","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"ed91b19449fa19d8a88de431d0c6273c203bb711","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.8.tgz","integrity":"sha512-pqVUnli8sbVm6A6Gk/SnfQSCSYVf4+Tr/JdzGPGJQxRxqHcVBEqiIltUT0TTxw7XbMInDvdg1iHf/9NZerz+7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyB/6b87ncKptYoj8V9Slvrk27iXZefstIo+/NTUqbEAIhAMpCzDR27NtcNSh96Q+AHX+7g56MVwArmp/zpmRixSvV"}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.9":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.9","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.9","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"3b677d8df2bfac1ea6e3955739ca5c5de283004b","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.9.tgz","integrity":"sha512-TvZm2I6AowIIC7iElhumSAlD2ZJWuZr40YMj+ktzYpwIe/5w+45htsPDwDn+w5uUCT7pMPPDGoTeYsb7ni0UBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDANWUrX4YF/yrmKuvO8p0L+TqAeEudwoay91geHdlxfwIhAOrL+ULYjOOWB5qC2kFiBBWQnzNA401Nr+ij4TlFWLO8"}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.10":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.10","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.10","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"f96ba08aa5928ec8c391f885a6724b7935c5337e","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.10.tgz","integrity":"sha512-+tr4krm5fHhTA4RH0W+A8TmGh8YHvIh+9aJGn05wyCqzOthK4P0AHVU0nyZg/n0XfLrgriS3o1mdS0QCuBnTJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8XF1LoMhE9NQTE4JBHkObDZQKR+NBCdp4pAcOr5Qv2wIgfJRbphiE3atORAZcrc1Ka4C5F2uKJeqFOHiX5Ffm0U4="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"directories":{}},"0.1.11":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.11","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.11","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"fe9dfebadcdb59cd0a765bba44fb3ae09405cc45","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.11.tgz","integrity":"sha512-XME2l016PXHOv0HTXECAXJBNANLq9d6Y2BQCEs5keHawCVcqzrzZ/p0LGLfVrqQ2HziV4Bc5GSubB01xH0DUjg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDX3OFof/zroiqmVUyjmvHbbLbJaOaYNBVtfeq/UkJVRAiAy5fNuf0o1kw8Jzy+VwHgHARKw57Fc7qWV+UuZGNOPag=="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.12":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.12","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.12","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"20f889db82383326fc8768791accfe46cf056ebd","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.12.tgz","integrity":"sha512-AWaq6NH2D8vWLmGzmVb9ND8ocpRZKZ5w8rFaOjQTPpUztNx1uC2deBpCfn7sZuQY2IIoebX9eBhuiBvo8FUpBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMEJfVouU9TgVJbRlEzyPp0lJnFbMia+hklER8429EMAIgEzIZfZIKhvJkqEFrrPVXojf9k3WYmgoEng9pOV35K0U="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.13":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.13","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.13","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"42da34a04ff85e2ce19c0199d0b8f3ef81638a39","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.13.tgz","integrity":"sha512-/efD+x71JJaQ6FqKOP0RkSnpRRKQgOLXdICJhhuja/d5va/Oh0hVPKS8m/nAY1gfJGaMjA189m6LSd04viT/yA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDotePs366/5s6tHTG2eHwIW8clPuy0sNdIz2Z3Umcg6QIgWqBMEC9jclZwem+zthFDGpzToDba1lRNu+geK5eIfkQ="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.14":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.14","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.14","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"c40999bccb42ead5dfe9cbe4eaed4d77e22f5d5f","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.14.tgz","integrity":"sha512-Opt/N32HlvLaK4Zh1kcqNlv+W3KhTpf+g6IX3+w8dacYQs4zqr+18hDJhjsURUjJgD8zpqEB5yzSeVGE9nlHXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA/eH+WFCs9EDkonpAMne6MrldSlhy+AajTcPewqgUSvAiEAouQJnSZnQa3xtmq05/vbz8hI4CkWgTvcLnKXQIMDaFw="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.15":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.15","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.15","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"b6e36b7147cbeac07eef9e858d3c73990313aa7e","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.15.tgz","integrity":"sha512-YY8JN4jbZaUsxeYHWbc1M4fi9cS6UExAHD7PT/ym7PBlxVREBtPA1jKaqykT3i8IlO/mCjKMnRpX1qSMP8unyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCykmL/ALdZnXfCQsX+b8FvgMzzbLGd59Jf2+y1xDCXwwIhAOTcxXK88qbc+WiYNz8DcP/k86FvnRhV/XA81jafINnT"}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.16":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.16","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.16","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"cce6ca0d3d754a30ccbf67d541b010b3009a3d2e","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.16.tgz","integrity":"sha512-iWp439xjTscMEQeKl2kAH86uCihjDs2hbJpydxBGwIQYr/LDi+DI2+ZaTPXuHXfZ7HrjVtDRGLPnkaiJj4AZQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuPWTR2XHYVI+DS1ciol5ltgGwfu2tGjjejv3NqyRubgIgFvPskp05PmlSN7JVJSAAy9FeZzTBxH06ynwZgAuHAsA="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.17":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.17","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.17","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"727f1b8d2b6b11cd31889ab61f67de2d827643de","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.17.tgz","integrity":"sha512-eGCjSRxn8r61p7ZSj6GYmWKUHgvGImArTNaGKe+8DV0+UYSfRZTPBe/6jJscDw06Z5eHUZrrbmADbhDLQr7STw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVa81BnGZ+yam5eMF97ckZzLLZT1OUS8SYSry3plqPNAiAobHiJ1CwsFUgslmT0Jix8KMHTtBMaRZX1Z94th7Vt0g=="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.18":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.18","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.18","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"359dc5f2f1e4b66f9bba02db13905cbe068de4b6","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.18.tgz","integrity":"sha512-ZFKk26ZQfnLsnrq0wc+pEaOApP4SyxnYKZj2HXVmTCe9a+Gw7o6J44cHp/+eQqlOb0LsXkKDNvdLeoJekR63PQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnENgFxNdXVvpU+M9j9o/RMJ19a4Ly//H1uhvFeBQM0QIgDcqgtk2mJQl/y4X9Nmh6vN3dCc+5Uc5nPnqjxX2KEAo="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.19":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.19","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":">= 0.2.1","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"tap":">=0.1.0","tapr":">=0.1.0"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/tapr/bin/tapr.js test/*.js"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.19","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"9355eed2fd91a5eb2783c1a3236971e17042ef82","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.19.tgz","integrity":"sha512-b+4smuD8f2MeJIbXLmuUQlkQBd6AdBjAhZwn64jfnQ4th5WiH5/8vayozHvCqvcNmAB3k5lYamKnpoxELTtNqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAzlQFv5xYZeTdBOid4oTxyAvI3dlpeApJZLr11bwM71AiBzfWKpcEG52ioICIWBC9uharH9o0RKopdYV+l66KdQFQ=="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.20":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.20","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":"= 0.2.2","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.20","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"9b08cc9203f8b8ba9084c963972757599ec0e780","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.20.tgz","integrity":"sha512-zhkIixY95TrE8kDMlUbXrU7KTI7M1Fwv/zheC46s0jeIzXO5UefXe14x+sH0X4EHlKO/LGhkUMpRTgOigW63ng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE5PM1wm7tX9YQegkH8h5VhM+qpJZ9h5XtJO/tXUlCB2AiAFAsQRBVsKm9EMFwQ9pqOukARRU2a/Zja873qlkam3bQ=="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.21":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.21","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":"= 0.2.2","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1","js-yaml":">= 0.3.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.21","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"3a2ce562e200ede574b3cf2b33eb1eaab2942300","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.21.tgz","integrity":"sha512-r316P5uY4Osuxn4ZVLZgp4Pp2ewzUc0bn6xBx4ldjMqcYjaH1zlKTgjTkCRKPKGNqF6OiKctGZnYV09KUmjNRw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZgQK/uaP/RhvK8rmRpX2FZep8DqvhpT3lIinMvsTNfAIhAOG40/oFS698a9eJeENVctMB3xAmKfj8dbLa/K4qo8t/"}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.22":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.22","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":"= 0.2.2","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1","js-yaml":">= 0.3.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.22","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"8477ecc51c9b3a2258217ee06ddbe17ec94b176a","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.22.tgz","integrity":"sha512-dCAyjOnTLH9r4lNRRvHheRjOCOvG/udIKhPaQ+X5nBJzYw9OgAI9DX4oh2ETO8LDqmQ8bOoXuHDg8P07Y3DeVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDT0IO/QEfU+fyfbG8JjlEPg6Qd0AHgvVFcedtFIT+/gIhAOjAtR2NTH2NkL0QT5rHARoLnQn51CV1r4auAdMheajy"}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.23":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.23","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":"= 0.2.2","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1","js-yaml":">= 0.3.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.23","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"0cb654428ac0734a7b34e291cad1d323ad9f7fad","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.23.tgz","integrity":"sha512-++7iqcwJnX7JTv/3SVpUoevgDFlV35fi3pHj9yiGCjSwi9jUgodcpmtjbNBndr+pm4AYt40HV3s7eP354/WZzg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDv6qh31WtOimPzkQh+wp7T+1oJYir01YIiKpII32sMUAIhALbJN7ftRADfu7O4bEI7NPXIE+aN/ZPAwN3+T/HA9w18"}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.24":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.24","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":"= 0.2.2","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1","js-yaml":">= 0.3.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.24","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"8ce1e3d05fd8f191ad6be07350c4da9774d2b203","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.24.tgz","integrity":"sha512-qAw/v/fmwTNp0Sp0R9lE7s9YaueeXsvFAK2TCwfGhTPVuor347N7F984BR35EBtinuvIbvvTwk0xbFXat0weoA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjoSI3vAxVW7thkCJKmEjkBSZRru4VmbIdT+O6sVFfnwIgAZRZwQtBw+0TZp/G/i6K5oEMee3KNQNRGSO/cTFbc1c="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.25":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.25","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":"= 0.2.2","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1","js-yaml":">= 0.3.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.25","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"b44745e1c85b229c57e7278c00224556b8599a75","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.25.tgz","integrity":"sha512-E2z0FKJyeYf24Dqzf6L+/Ky+pkJVUwHbNFfWcsW/Jvu/x2OrhMknIlMM5HwALr+Dy+rsO9xoTFnWD/u/bDKGdA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSYUKFVx/ZH7JIMniDS/uA8ZWgWaj42hN//xdAkdZc0wIgF1igLoMngUrrtiB7V65ZUNyfhROH0WKbscQbzvWDfs0="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.26":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.26","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":">= 0.2.8","async":">= 0.1.9","ncp":"= 0.2.2","pegjs":">= 0.6.2","handlebars":">= 1.0.0","github-flavored-markdown":">= 1.0.0","underscore":">= 1.2.2","mkdirp":">= 0.2.1","showdown":">= 0.0.1","js-yaml":">= 0.3.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.26","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"342f146f43f391fe9511713de56f4a2b7bd6c0f1","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.26.tgz","integrity":"sha512-S1Q3tRqP7X8yiu2JCbd13cg6HamDqwftVWtiEs27lDD9l5yb0g5mFOjWspm/bJjWivBdatjBTU+G4G9exmRNwQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDe8Tg/9Nj4ihBRxLM2NKV4Ol2xzjdDVzbv58AbZLeSyAIgLwbmjvbImMGkjsIywpL8qHugzJbysNbIu0AoH8SwXks="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.27":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.27","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":"~0.3.1","async":"~0.1.9","ncp":"=0.2.2","pegjs":"=0.6.2","handlebars":"~1.0.0","github-flavored-markdown":"~1.0.0","underscore":"~1.2.2","mkdirp":"~0.2.1","showdown":"~0.0.1","js-yaml":"~0.3.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.27","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"3f15fd04b0e5d8154665d78d482ee62a36d2807c","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.27.tgz","integrity":"sha512-8WgmGcd+jVr6tMd+TdCnujD5OdeLCrQ8ACu8sEZbG2GX2/KJXkndgRGoNow6I9l9eio0iG5h3J71mBdgCmoXKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC//+/uZtQ5BE1tmd/a5z/d0NdVInG7/qN+cXyIFJomgAIhAI/GWNycNsChkR9oxIM+yubdsYJ+WZ1HHVTC00OXoezt"}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can override the grammar for a specific file extension:\n\n```\ndoctor myfile1.js myfile2.foo --grammar.foo foo\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.28":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.28","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":"~0.3.1","async":"~0.1.9","ncp":"=0.2.2","pegjs":"=0.6.2","handlebars":"~1.0.0","github-flavored-markdown":"~1.0.0","underscore":"~1.2.2","mkdirp":"~0.2.1","showdown":"~0.0.1","js-yaml":"~0.3.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.28","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"2215963225291f77ac66911e7e15c96c4c88354b","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.28.tgz","integrity":"sha512-kvMfscDmEgHJ/h6zMMefTM9gt24DbOdpuAVXZDd0bTu4qD4Y5t/kylby17HQFkPRItfjb9FSIHSzid3HxjhtNw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDimt2AAKRnWjonj+FXqI9BKllFqNxzWM6R5ftHNSLF/QIgYAw5/ZSDEcf4VaHFiE8RMyV63G8naJ5qAT37lmIYdEY="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can override the grammar for a specific file extension:\n\n```\ndoctor myfile1.js myfile2.foo --grammar.foo foo\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.29":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.29","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":"~0.3.1","async":"~0.1.9","ncp":"=0.2.2","pegjs":"=0.6.2","handlebars":"~1.0.0","underscore":"~1.2.2","mkdirp":"~0.2.1","js-yaml":"~0.3.5","marked":"~0.2.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.29","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"f9899dc4a7d4c0a138db84780bd6d78f5c733f04","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.29.tgz","integrity":"sha512-VVuRddW2l5C3w/mqZpgZFp9v/b936V9zqu1smcYcb1nsL+2JekGrxGgKB5kaNo09icZjPcly9r8tJlE3DTA8SQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCCXyrUPx19syd8htQ8uYvYoKThMDZ/TjWpGrdTUlIPQIhAI53VEHXvwrqpX/QSlygD7sVUWQVm3e2kIGfVzFUf52E"}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can override the grammar for a specific file extension:\n\n```\ndoctor myfile1.js myfile2.foo --grammar.foo foo\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.30":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.30","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":"~0.3.1","async":"~0.1.9","ncp":"=0.2.2","pegjs":"=0.6.2","handlebars":"~1.0.0","underscore":"~1.2.2","mkdirp":"~0.2.1","js-yaml":"~0.3.5","marked":"~0.2.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.30","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"2f86f18251005a57db811cc47cdfc5faeb122843","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.30.tgz","integrity":"sha512-5Zbi2Ez3p86cy9knIJnSfVieDEDEaMOLRXKGIYbBAB/ZdUrDTjcHqNrWEuBNNO2uYPh7aCuE0iU9S1TptPN2EA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICaQz80uqpxI+u8GzcOjMyGdV1uii2hwsW7vbHklQxCWAiEAhP6P4S2OsPcJdnmTZsliEhY0CpO0pwSxkN0UwlGPDzU="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/README/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/README/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can override the grammar for a specific file extension:\n\n```\ndoctor myfile1.js myfile2.foo --grammar.foo foo\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.32":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.32","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":"~0.3.1","async":"~0.1.9","ncp":"=0.2.2","pegjs":"=0.6.2","handlebars":"~1.0.0","underscore":"~1.2.2","mkdirp":"~0.2.1","marked":"~0.2.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3","js-yaml":"~0.3.5"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/images/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/images/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can override the grammar for a specific file extension:\n\n```\ndoctor myfile1.js myfile2.foo --grammar.foo foo\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","_id":"doctor@0.1.32","dist":{"shasum":"0de1bb8ffb1e3ca3c013645c0d9b7d40878ccf70","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.32.tgz","integrity":"sha512-1k94SJSpGQIf/va8dx3QWN0iKrjhDyjUqqFBZNtNsNtXCmyj/Wiquj7javBPXekOC6wglHb/WiDOks/lbqtLcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZ9r/kYPt+jQSElIZSt8yIXefq/My5K5u0CiALcJUI9AiBX+CKN5lVwiF1QcFrxnIcA78kPz6aYyaLnkYgbogSqlw=="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.1.33":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.1.33","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":"~0.3.1","async":"~0.1.9","ncp":"=0.2.2","pegjs":"=0.6.2","handlebars":"~1.0.0","underscore":"~1.2.2","mkdirp":"~0.2.1","marked":"~0.2.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3","js-yaml":"~0.3.5"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"_id":"doctor@0.1.33","_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"45bf6d1d87704c90bdd98cbbc26a3551a140238b","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.1.33.tgz","integrity":"sha512-TkwA7oBkr1HzqgwdOjsBHFmrFxpG3Cahqx7ImyLIrNcFI9brXiGZbOfDVYvd/TM8rOWIQ7PL78foBjOL07sAlQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDaR5LWW1XkLq3eC2oVzfv0u8nxaBF2Sp5O64NvLN0DpAiEAjjsf5j974E7YNE0BlL3EmLja9Ynd0Yf35iX1OYso6gM="}]},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__\n\n![pinch](https://github.com/jdeal/doctor/raw/master/images/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/images/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a hash\ntable of items and groups of items. The report is optionally run through a\nrender module to convert the report to some format other than a single JSON\nfile.\n\nAs a service, doctor also takes a number of view directories and merges them\ntogether into a single output directory, along with the report file(s). If the\ndefault single-file JSON is used, the view will be a JavaScript-based viewer\nthat converts the report items into HTML.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```\nnpm install doctor\n```\n\nor if you want the latest\n\n```\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nThis is how doctor documents itself from the command-line:\n\n```\ndoctor lib/*.js -v default -v doctor -o doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```\ndoctor myfile1.js myfile2.js\n```\n\nTo write out the report file, give it a directory:\n\n```\ndoctor myfile1.js myfile2.js -o output\n```\n\nAnd it will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nTo merge in your own files into the view, pass multiple views:\n\n```\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nYou can override the grammar if you feel adenturous:\n\n```\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nYou can override the grammar for a specific file extension:\n\n```\ndoctor myfile1.js myfile2.foo --grammar.foo foo\n```\n\nYou can add your own transform rules:\n\n```\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nOr your own report rules:\n\n```\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nYou can use a custom renderer:\n\n```\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: ['default', '~/more-report-rules.js'],\n  render: 'markdown'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\nNote that the above options probably don't really make sense. The default viewer\ndoesn't work with output from the markdown renderer.\n","maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.2.0":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.2.0","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":"~0.3.1","async":"~0.1.9","ncp":"=0.2.2","pegjs":"=0.6.2","handlebars":"~1.0.0","underscore":"~1.2.2","mkdirp":"~0.2.1","marked":"~0.2.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3","js-yaml":"~0.3.5"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__ It is probably stable enough to be useful, but no promises.\n\n![pinch](https://github.com/jdeal/doctor/raw/master/images/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/images/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a flat\nJSON object containing items and groups of items. The report is optionally run\nthrough a render module to convert the report to some format other than a single\nJSON file.\n\nDoctor also provides an option that takes a number of view directories and\nmerges them together into a single output directory, along with the report\nfile(s). A default HTML/JavaScript view is provided to view the default report\nas HTML.\n\nDoctor has initial (rough) support for markdown as well, integrating that into\nthe report if passed along with the source.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```bash\nnpm install doctor\n```\n\nor if you want the latest\n\n```bash\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nNote that these examples assume a shell that expands wildcards.\n\nThis is how doctor documents itself from the command-line:\n\n```bash\ndoctor lib/*.js *.md -v default -v doctor -o ../doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\nThe above command (when run from inside doctor's repository directory) takes all\nthe .js files and all the .md files and runs them through the default transform\nand default report rules. It puts the report into ../doc and merges the default\nand doctor views into ../doc. For many of doctor's options, it will look for a\nbuilt-in resource first and then try to find it in the directory provided. In\nthis example, doctor has views named default and doctor, so it finds them in\nitself. If an alternate view was provided, say my-view, it would look for that\npath, whether it be local or absolute.\n\nThese and other options are described in more detail in the command-line section\nbelow.\n\nYou can also look at the [examples](http://github.com/jdeal/doctor/tree/master/examples).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```bash\ndoctor myfile1.js myfile2.js\n```\n\nIf no output directory is provided, doctor will throw the report (or whatever is\nrequested, such as the raw AST) to the the console.\n\nTo write out the report file, give it a directory:\n\n```bash\ndoctor myfile1.js myfile2.js -o output\n```\n\nDoctor will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```bash\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nWhen doctor sees the .json extension like this, it assumes you mean to rename\nthe report.\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```bash\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```bash\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nThe default viewer files will be located in the output directory along with your\nreport.\n\nTo merge your own files into the view, pass multiple views:\n\n```bash\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nWhen multiple views are passed, they are processed in order. So, if a later view\ncan overwrite a previous view's files. This is useful when you want a view to\ndiffer only slightly. This is how doctor documents itself, by overriding the\nconfig file of the default view.\n\nYou can override the grammar if you feel adenturous:\n\n```bash\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nNote that the JavaScript grammar is pretty complicated, so you probably want to\nuse doctor's included grammar (in grammar/javascript.pegjs) as a starting point.\n\nYou can override the grammar for a specific file extension. This is necessary if\nyou want to alter the JavaScript grammar for .js while leaving the markdown\ngrammar registered for .md.\n\n```bash\ndoctor source.js readme.md --grammar.js ~/my-js-gramar.pegjs\n```\n\nYou can add your own transform rules:\n\n```bash\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nTransform rules are useful for modifying the AST prior to creating reports.\nThey're powerful, but also easy to mess up. Look at doctor's own transform rules\n(transform/default) for examples, or look in the examples directory for simpler\nexamples.\n\nPerhaps most important, you can add your own report rules:\n\n```bash\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nThis is what doctor is all about. You can look at doctor's own rules\n(report/default), but these are pretty complicated. Some simpler examples are\nin the examples directory.\n\nYou can also use a custom renderer:\n\n```bash\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\nThis allows you to modify the resulting JSON report or convert it to something\nelse entirely. Doctor's default renderer exists only to convert markdown to\nHTML. You'll also find a markdown renderer (default/markdown) which is meant\nto convert the JSON to markdown files, but this is not finished.\n\nBy default, doctor passes unknown JSDoc tags through to the report, but you can\nhave it complain if it sees unknown tags:\n\n```bash\ndoctor myfile1.js --no-unknown\n```\n\nAny of the default enabled options (grammar, transform, report, render, and\nunknown) can be disabled by prefixing the option with no-.\n\nYou can force doctor to return its AST like this:\n\n```bash\ndoctor myfile1.js --no-transform --no-report --ast\n```\n\nNotice that we turned of the transform and report rules in this example. We\ncould leave the transform rules enabled if we wanted to see the AST after\ntransformation. If we leave the report active, we'll get an object returned\nthat contains the AST and the report.\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: {js:\n    ['default', '~/more-report-rules.js']\n  },\n  render: 'default',\n  unknown: false,\n  output: '~/documentation'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\n## API\n\nFor writing transform and report rules, you'll need to learn doctor's API. You\ncan see doctor's own documentation for that:\n\nhttp://jdeal.github.com/doctor/doc\n\n## Conventions\n\nThe default rules supplied by doctor (report/default) will document the\nfollowing conventions in your code. (In this section, _doctor_ may refer to\ndoctor and its default rules.)\n\n### CommonJS modules\n\nDoctor only documents the public API, via CommonJS exports.\n\n```js\nexports.foo = function () {};\n```\n\n```js\nmodule.exports = {foo: function () {}}\n```\n\n```js\nmodule.exports = function () {}\n```\n\nNote that doctor can find many variations of the above patterns. For example,\nit can generally see when you're setting variables and then exporting those\nvariables, even if you're setting the variables to other required modules. If\ndoctor can't figure out what you're exporting, there's a good chance humans also\ncan't figure it out.\n\n### AMD modules\n\nDoctor sees AMD-style exports as well.\n\n```js\ndefine(function () {\n  return {foo: function () {}};\n});\n```\n\nAgain, it can see some variations of\nthis, although it may not be quite as resilient as node-style exports.\n\n### Function parameters\n\nOf course, doctor documents parameters of exported functions.\n\n```js\nfunction foo(bar) {}\n```\n\n### Optional parameters\n\nDoctor can see where a parameter is given a default value.\n\n```js\nfunction foo(bar) {\n  bar = bar || 'baz';\n}\n```\n\n### Constructors\n\nDoctor will assume upper-case functions are constructors.\n\n```js\nfunction Foo() {}\n\nmodule.exports = Foo;\n```\n\n### Instances\n\nDoctor can see when an instance is exported.\n\n```js\nfunction Foo() {}\n\nFoo.prototype.bar = function () {};\n\nmodule.exports = new Foo();\n```\n\nGiven that export, doctor knows your module has exported a function named bar.\n\n### Following dependencies\n\nDoctor can follow require.\n\n```js\nvar bar = require('./bar');\n\nexports.bar = bar;\n```\n\nAnd it can follow AMD dependencies.\n\n```js\ndefine(['./bar'], function (bar) {\n  return {bar: bar};\n});\n```\n\nNote that doctor will only document what is passed to it. It will not document\ndependent modules, except when they are exported from a passed-in module.\n\nSo, if the above code is part of foo.js, and you call doctor like this:\n\n```bash\ndoctor lib/foo.js\n```\n\nbar.js will not be documented, even though doctor follows it.\n\n### Literal prototypes\n\n```js\nfunction Foo() {\n}\n\nFoo.prototype = {\n  bar: function () {\n  }\n}\n```\n\n## JSDoc tags\n\nWhere doctor cannot infer documentation from convention, JSDoc tags can be used\nto annotate the code.\n\nNote that you can use multi-line or single-line comment style.\n\n### @description\n\nAdd a description to a function, using markdown.\n\n```js\n/*\n@description Returns a greeting.\n*/\nfunction hello() {\n  return \"Hello!\";\n}\n```\n\nIf a comment appears with no tag, it is assumed to be a description.\n\n```js\n/*\nReturns a greeting.\n*/\nfunction hello() {\n  return \"Hello!\";\n}\n```\n\n### @param\n\nAdd a description and optional type to a function parameter.\n\n```js\n/*\n@param {string} name - Name of a person.\n*/\nfunction greeting(name) {\n  return \"Hello, \" + name + \".\";\n}\n```\n\nNote the optional dash (-) which can be used to visually separate the\ndescription.\n\nNote that doctor will match the parameters to the name of the function. So a\nfunction like this:\n\n```js\n/*\n@param {number} y - The y, of course.\n*/\nfunction foo(x, y, z) {\n  return x * y + z;\n}\n```\n\nwill add a description to the y parameter. This is different from JSDoc which\nmatches the parameters by position.\n\nIf a parameter is an object with certain properties, you can document the\nproperties like this:\n\n```js\n/*\n@param {object} car - The car.\n@param {number} car.speed - The speed of the car.\n*/\nfunction drive(car) {\n  console.log(\"The car is going \" + car.speed + \"mph.\");\n}\n```\n\nIf a parameter is a function with certain parameters, you can document the\nparameters like this:\n\n```js\n/*\n@param {function(err, message)} callback - Function to call when finished.\n*/\nfunction waitAndThen(callback) {\n  setTimeout(function () {\n    callback(null, \"hello\");\n  }, 1000);\n}\n```\n\nNote that doctor's default view doesn't do anything except parrot these\nparameters, but they are available in the report.\n\nOptional parameters can be documented with brackets, and default values can be\ndocumented with an assignment.\n\n```js\n/*\n@param {string} [name = \"you\"] - Name of a person.\n*/\nfunction greeting(name) {\n  name = name || \"you\";\n  return \"Hello, \" + name + \".\";\n}\n```\n\nAs noted above though, this is unnecessary, as doctor can see the convention for\noptional parameters.\n\n### @return, @returns\n\nDocument the return type of a function.\n\n```js\n/*\n@returns string\n*/\nfunction foo() {\n  return \"bar\";\n}\n```\n\n### @class\n\nAdd a description for the class.\n\n```js\n/*\n@class A useful widget.\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\n### @constructor\n\nAdd a description for the constructor.\n\n```js\n/*\n@constructor Makes a widget.\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\nThis is not really necessary since doctor sees upper-case functions as\nconstructors. In doctors default view, the constructor description just gets\nconcatenated to the description.\n\n### @example\n\nAdds example usage to a module or function.\n\n```js\n/*\n@example\nvar msg = greeting();\n*/\nfunction greeting() {\n  return \"Hello!\";\n}\n```\n\n### @extends\n\nSets the base class for a class.\n\n```js\n/*\n@extends Widget\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\n(Yes, doctor should be support a convention for this.)\n\n### @private, @public\n\nDoctor's default rules assume that everything exported is public and everything\nelse is private.\n\nYou can explicitly set something to private to hide it in\ndoctor's default rules.\n\n```js\n/*\n@private\n*/\nmodule.exports._foo = function () {\n  return \"Don't use me. I'm not documented!\";\n}\n```\n\nYou can explicitly set something to public to force doctor to add it to the\nreport. For example, in some cases, you may export something (say, via a\nreturn value of a function) that doctor doesn't see as public. If you mark a\nconstructor as public, doctor will automatically add all methods of that class\nto the report as well.\n\n```js\n/*\nSecret constructor.\n\n@class Secret maker.\n\n@public\n*/\nfunction Secret() {\n}\n```\n\n### @signature\n\nThis allows documenting alternate signatures of a single function. For example,\na setter and getter can sometimes be the same function. The @signature parameter\nset the description for these signatures and allows overriding parameter \ndescriptions.\n\n```js\n/*\n@param name - Attribute name.\n*/\nfunction attr(name, value) {\n/*\n@signature Get attribute value.\n@param value - Attribute value.\n*/\n  if (typeof value === 'undefined') {\n\n  }\n/*\n@signature Set attribute value.\n*/\n}\n```\n\n### @copy\n\nThis allows copying the tags from another function in the case that one\nfunction shares parameters or descriptions with another function.\n\n```js\n/*\nCreate a TPS report.\n@param name - Author of the report.\n@param verbose - Add \n*/\nfunction createTpsReport(name, verbose) {\n  return {\n    name: name,\n    summary: \"I didn't get any cake.\"\n  }\n  if (verbose) {\n    console.log(\"wasting time...\");\n  }\n}\n\n/*\n@copy createTpsReprot\n*/\nfunction createVerboseTpsReport(name) {\n  createTpsReport(name, true);\n}\n```\n\n### @abstract\n\nReally? What, are you a Java programmer?\n\nFine, this marks a class as abstract.\n\n## Writing custom rules\n\nDoctor's default rules are useful for normal documentation tasks, but you can do\nall kinds of neat things by writing your own rules.\n\nA rules module should export an array of rules or an object with a \"rules\"\nproperty. If multiple rules match the same AST node type, then they will fire\nin the order in which they declare.\n\n### Transform rules\n\nTransform rules follow this pattern:\n\n```js\n{\n  type: 'define-function',\n  match: function (node) {\n    var name = node.nodes[0].value;\n    return name === 'foo';\n  },\n  transform: function (node, report) {\n    node.remove();\n  }\n}\n```\n\n__type__\n\nThis property should be a string specifying the AST node type or an array of\nnode types. Note that you can use pseudo-end node types, for which rules will\nfire after all descendent node rules have fired. For example, define-function\nhas a corresponding end-define-function which will fire after the entire body\nof the function has been processed.\n\n__match__ (optional)\n\nThis property is an optional function that can further filter the node.\n\n__transform__\n\nThis property is a function that is called to transform the node.\n\n### Report rules\n\nReport rules follow this pattern:\n\n```js\n{\n  type: 'define-function',\n  match: function (node) {\n    var name = node.nodes[0].value;\n    return name === 'foo';\n  },\n  report: function (node, report) {\n    var name = node.nodes[0].value;\n    return {\n      key: 'define-function:' + name,\n      name: name\n    }\n  }\n}\n```\n\n__type__\n\nThis property should be a string specifying the AST node type or an array of\nnode types. Note that you can use pseudo-end node types, for which rules will\nfire after all descendent node rules have fired. For example, define-function\nhas a corresponding end-define-function which will fire after the entire body\nof the function has been processed.\n\n__match__ (optional)\n\nThis property is an optional function that can further filter the node.\n\n__report__\n\nThis property is a function that manipulates the report, either via the report\nparameter or by returning a report item or an array of report items.\n\n## AST node types\n\nIf you write your own rules, you'll need to know the following AST node types.\n\nAs noted above, each AST node type has a corresponding end type. So\ndefine-function has a matching end-define-function.\n\n### files\n\nA group of all files. Rules for this node type (and the corresponding end-files)\nwill fire only once.\n\n### file\n\nEach file.\n\n### undefined\n\nUndefined node. For example: if an else clause of an if statement is\nundefined, the else clause will be an undefined node.\n\n### name\n\nAn identifier. For example: a function name, a variable name.\n\n### number\n\nA number. For example: 3, 5.6.\n\n### string\n\nA string. For example: \"hello\".\n\n### null\n\nA null literal.\n\n### boolean\n\nA boolean literal (true or false).\n\n### regex\n\nA literal regular expression.\n\n### regex-body\n\nThe body (between the slashes) of a regular expression.\n\n### regex-flags\n\nThe flags (after the second slash) of a regular expression.\n\n### this\n\nThe \"this\" keyword.\n\n### object\n\nA literal object.\n\n### property\n\nA key and value set of a literal object.\n\n### get\n\nGetter.\n\n### set\n\nSetter.\n\n### new\n\nUsing new to instantiate an object with a constructor.\n\n### dot\n\nUsing dot to access a property or method. For example: foo.bar, foo.baz().\n\n### call\n\nA function call.\n\n### subscript\n\nUsing brackets to access a property or index. For example: foo[0], foo[\"bar\"].\n\n### expression\n\nA parenthetical expression. For example: (3 + 5), (a || b).\n\n### postfix\n\nA postfix expression. For example: x--, i++.\n\n### operator\n\nThe operator used in an expression.\n\n### unary\n\nA unary prefix expression. For example: --x, ++i;\n\n### binary\n\nAn binary expression. For example: 3 + 5, a || b.\n\n### conditional\n\nA conditional expression.\n\n### assign\n\nAssignment of a value to a variable.\n\n### vars\n\nA group of variable declarations.\n\n### var\n\nA single variable declaration.\n\n### empty\n\nAn empty statment, which basically means a semicolon by itself.\n\n### if\n\nAn if statement.\n\n### do-while\n\nA do-while statement.\n\n### while\n\nA while statement.\n\n### for\n\nA for loop.\n\n### for-in\n\nA for-in loop.\n\n### continue\n\nA continue statement.\n\n### break\n\nA break statement.\n\n### return\n\nA return statement.\n\n### with\n\nA with statement.\n\n### switch\n\nA switch statement.\n\n### case\n\nA case statement of a switch statement.\n\n### default\n\nA default statement of a switch statement.\n\n### nodes\n\nA group of AST nodes, which is part of another node. For example, the body of a\nfunction is a node of type \"nodes\" containing all the nodes of the body.\n\n### labeled-statement\n\nA labeled statement.\n\n### throw\n\nA throw.\n\n### try\n\nA try.\n\n### catch\n\nA catch clause of a try.\n\n### finally\n\nA finally clause of a try.\n\n### debug\n\nA debugger statement.\n\n### define-function\n\nA function definition.\n\n### function\n\nA function expression.\n\n### parameters\n\nThe parameters of a function.\n\n## FAQ\n\n### Why did you do this? Don't you know [insert here] already exists.\n\nYeah, but [insert here] works off of comment tags and not off of coding\nconventions. And [insert here] doesn't make it easy to add new conventions. And\n[insert here] isn't a pure node module. And doctor aims to be a general purpose\ncode analysis tool.\n\n### Seriously, why did you do this?\n\nSome kind of OCD thing.\n\n### Why isn't this split into two projects, one for the analysis tool and another for code documentation?\n\nMaybe it should be. It grew up that way, and I haven't spent any thought or\neffort on splitting it.\n\n### Why is the code so ugly? What's with all these weird wrapping closures around fs and path?\n\nThat is thanks to synchronous require. I love node, but I hate synchronous\nrequire. (Yes, I understand why it's synchronous.) Because I wanted doctor to\nwork asynchronously or synchronously, I had to make asynchronous signatures for\nthe synchronous functions and then swap them out as needed.\n\nThe rest of the ugliness is my fault.\n\n### How do I contribute?\n\nThe usual: fork, add a (preferably discrete) fix/change with the necessary\ntests, and do a pull request. I can't promise to respond immediately or even in\na reasonable timeframe, but I'll do my best to eventually get to it.\n\n### Have these questions actually been frequently asked?\n\nNo, just being proactive.","_id":"doctor@0.2.0","dist":{"shasum":"1e8228dd655a4805dd0dcfe75d0c1f59987a738a","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.2.0.tgz","integrity":"sha512-kXfV3JEtJ9XvVEHjEe3hfluYL4reuNKm6048bVv1GqAFjB/lJgDeNHPufqWy0SRW8kZ9kd0Wxyh0R+z/4kK0OA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsuQA3eaQdISK+ABG4R4V8txwestBiE+iF9cxv6fpbigIhALA3RPDNgCUieiFhoZQOLTXN3FDqDuMYaeyMFJfxnSjH"}]},"_npmVersion":"1.1.62","_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.2.1":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from a JavaScript AST.","version":"0.2.1","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":"~0.3.1","async":"~0.1.9","ncp":"=0.2.6","pegjs":"=0.6.2","handlebars":"~1.0.0","underscore":"~1.2.2","mkdirp":"~0.3.4","marked":"~0.2.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3","js-yaml":"~0.3.5"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__ It is probably stable enough to be useful, but no promises.\n\n![pinch](https://github.com/jdeal/doctor/raw/master/images/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/images/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a flat\nJSON object containing items and groups of items. The report is optionally run\nthrough a render module to convert the report to some format other than a single\nJSON file.\n\nDoctor also provides an option that takes a number of view directories and\nmerges them together into a single output directory, along with the report\nfile(s). A default HTML/JavaScript view is provided to view the default report\nas HTML.\n\nDoctor has initial (rough) support for markdown as well, integrating that into\nthe report if passed along with the source.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```bash\nnpm install doctor\n```\n\nor if you want the latest\n\n```bash\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nNote that these examples assume a shell that expands wildcards.\n\nThis is how doctor documents itself from the command-line:\n\n```bash\ndoctor lib/*.js *.md -v default -v doctor -o ../doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\nThe above command (when run from inside doctor's repository directory) takes all\nthe .js files and all the .md files and runs them through the default transform\nand default report rules. It puts the report into ../doc and merges the default\nand doctor views into ../doc. For many of doctor's options, it will look for a\nbuilt-in resource first and then try to find it in the directory provided. In\nthis example, doctor has views named default and doctor, so it finds them in\nitself. If an alternate view was provided, say my-view, it would look for that\npath, whether it be local or absolute.\n\nThese and other options are described in more detail in the command-line section\nbelow.\n\nYou can also look at the [examples](http://github.com/jdeal/doctor/tree/master/examples).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```bash\ndoctor myfile1.js myfile2.js\n```\n\nIf no output directory is provided, doctor will throw the report (or whatever is\nrequested, such as the raw AST) to the the console.\n\nTo write out the report file, give it a directory:\n\n```bash\ndoctor myfile1.js myfile2.js -o output\n```\n\nDoctor will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```bash\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nWhen doctor sees the .json extension like this, it assumes you mean to rename\nthe report.\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```bash\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```bash\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nThe default viewer files will be located in the output directory along with your\nreport.\n\nTo merge your own files into the view, pass multiple views:\n\n```bash\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nWhen multiple views are passed, they are processed in order. So, if a later view\ncan overwrite a previous view's files. This is useful when you want a view to\ndiffer only slightly. This is how doctor documents itself, by overriding the\nconfig file of the default view.\n\nYou can override the grammar if you feel adenturous:\n\n```bash\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nNote that the JavaScript grammar is pretty complicated, so you probably want to\nuse doctor's included grammar (in grammar/javascript.pegjs) as a starting point.\n\nYou can override the grammar for a specific file extension. This is necessary if\nyou want to alter the JavaScript grammar for .js while leaving the markdown\ngrammar registered for .md.\n\n```bash\ndoctor source.js readme.md --grammar.js ~/my-js-gramar.pegjs\n```\n\nYou can add your own transform rules:\n\n```bash\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nTransform rules are useful for modifying the AST prior to creating reports.\nThey're powerful, but also easy to mess up. Look at doctor's own transform rules\n(transform/default) for examples, or look in the examples directory for simpler\nexamples.\n\nPerhaps most important, you can add your own report rules:\n\n```bash\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nThis is what doctor is all about. You can look at doctor's own rules\n(report/default), but these are pretty complicated. Some simpler examples are\nin the examples directory.\n\nYou can also use a custom renderer:\n\n```bash\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\nThis allows you to modify the resulting JSON report or convert it to something\nelse entirely. Doctor's default renderer exists only to convert markdown to\nHTML. You'll also find a markdown renderer (default/markdown) which is meant\nto convert the JSON to markdown files, but this is not finished.\n\nBy default, doctor passes unknown JSDoc tags through to the report, but you can\nhave it complain if it sees unknown tags:\n\n```bash\ndoctor myfile1.js --no-unknown\n```\n\nAny of the default enabled options (grammar, transform, report, render, and\nunknown) can be disabled by prefixing the option with no-.\n\nYou can force doctor to return its AST like this:\n\n```bash\ndoctor myfile1.js --no-transform --no-report --ast\n```\n\nNotice that we turned of the transform and report rules in this example. We\ncould leave the transform rules enabled if we wanted to see the AST after\ntransformation. If we leave the report active, we'll get an object returned\nthat contains the AST and the report.\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: {js:\n    ['default', '~/more-report-rules.js']\n  },\n  render: 'default',\n  unknown: false,\n  output: '~/documentation'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\n## API\n\nFor writing transform and report rules, you'll need to learn doctor's API. You\ncan see doctor's own documentation for that:\n\nhttp://jdeal.github.com/doctor/doc\n\n## Conventions\n\nThe default rules supplied by doctor (report/default) will document the\nfollowing conventions in your code. (In this section, _doctor_ may refer to\ndoctor and its default rules.)\n\n### CommonJS modules\n\nDoctor only documents the public API, via CommonJS exports.\n\n```js\nexports.foo = function () {};\n```\n\n```js\nmodule.exports = {foo: function () {}}\n```\n\n```js\nmodule.exports = function () {}\n```\n\nNote that doctor can find many variations of the above patterns. For example,\nit can generally see when you're setting variables and then exporting those\nvariables, even if you're setting the variables to other required modules. If\ndoctor can't figure out what you're exporting, there's a good chance humans also\ncan't figure it out.\n\n### AMD modules\n\nDoctor sees AMD-style exports as well.\n\n```js\ndefine(function () {\n  return {foo: function () {}};\n});\n```\n\nAgain, it can see some variations of\nthis, although it may not be quite as resilient as node-style exports.\n\n### Function parameters\n\nOf course, doctor documents parameters of exported functions.\n\n```js\nfunction foo(bar) {}\n```\n\n### Optional parameters\n\nDoctor can see where a parameter is given a default value.\n\n```js\nfunction foo(bar) {\n  bar = bar || 'baz';\n}\n```\n\n### Constructors\n\nDoctor will assume upper-case functions are constructors.\n\n```js\nfunction Foo() {}\n\nmodule.exports = Foo;\n```\n\n### Instances\n\nDoctor can see when an instance is exported.\n\n```js\nfunction Foo() {}\n\nFoo.prototype.bar = function () {};\n\nmodule.exports = new Foo();\n```\n\nGiven that export, doctor knows your module has exported a function named bar.\n\n### Following dependencies\n\nDoctor can follow require.\n\n```js\nvar bar = require('./bar');\n\nexports.bar = bar;\n```\n\nAnd it can follow AMD dependencies.\n\n```js\ndefine(['./bar'], function (bar) {\n  return {bar: bar};\n});\n```\n\nNote that doctor will only document what is passed to it. It will not document\ndependent modules, except when they are exported from a passed-in module.\n\nSo, if the above code is part of foo.js, and you call doctor like this:\n\n```bash\ndoctor lib/foo.js\n```\n\nbar.js will not be documented, even though doctor follows it.\n\n### Literal prototypes\n\n```js\nfunction Foo() {\n}\n\nFoo.prototype = {\n  bar: function () {\n  }\n}\n```\n\n## JSDoc tags\n\nWhere doctor cannot infer documentation from convention, JSDoc tags can be used\nto annotate the code.\n\nNote that you can use multi-line or single-line comment style.\n\n### @description\n\nAdd a description to a function, using markdown.\n\n```js\n/*\n@description Returns a greeting.\n*/\nfunction hello() {\n  return \"Hello!\";\n}\n```\n\nIf a comment appears with no tag, it is assumed to be a description.\n\n```js\n/*\nReturns a greeting.\n*/\nfunction hello() {\n  return \"Hello!\";\n}\n```\n\n### @param\n\nAdd a description and optional type to a function parameter.\n\n```js\n/*\n@param {string} name - Name of a person.\n*/\nfunction greeting(name) {\n  return \"Hello, \" + name + \".\";\n}\n```\n\nNote the optional dash (-) which can be used to visually separate the\ndescription.\n\nNote that doctor will match the parameters to the name of the function. So a\nfunction like this:\n\n```js\n/*\n@param {number} y - The y, of course.\n*/\nfunction foo(x, y, z) {\n  return x * y + z;\n}\n```\n\nwill add a description to the y parameter. This is different from JSDoc which\nmatches the parameters by position.\n\nIf a parameter is an object with certain properties, you can document the\nproperties like this:\n\n```js\n/*\n@param {object} car - The car.\n@param {number} car.speed - The speed of the car.\n*/\nfunction drive(car) {\n  console.log(\"The car is going \" + car.speed + \"mph.\");\n}\n```\n\nIf a parameter is a function with certain parameters, you can document the\nparameters like this:\n\n```js\n/*\n@param {function(err, message)} callback - Function to call when finished.\n*/\nfunction waitAndThen(callback) {\n  setTimeout(function () {\n    callback(null, \"hello\");\n  }, 1000);\n}\n```\n\nNote that doctor's default view doesn't do anything except parrot these\nparameters, but they are available in the report.\n\nOptional parameters can be documented with brackets, and default values can be\ndocumented with an assignment.\n\n```js\n/*\n@param {string} [name = \"you\"] - Name of a person.\n*/\nfunction greeting(name) {\n  name = name || \"you\";\n  return \"Hello, \" + name + \".\";\n}\n```\n\nAs noted above though, this is unnecessary, as doctor can see the convention for\noptional parameters.\n\n### @return, @returns\n\nDocument the return type of a function.\n\n```js\n/*\n@returns string\n*/\nfunction foo() {\n  return \"bar\";\n}\n```\n\n### @class\n\nAdd a description for the class.\n\n```js\n/*\n@class A useful widget.\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\n### @constructor\n\nAdd a description for the constructor.\n\n```js\n/*\n@constructor Makes a widget.\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\nThis is not really necessary since doctor sees upper-case functions as\nconstructors. In doctors default view, the constructor description just gets\nconcatenated to the description.\n\n### @example\n\nAdds example usage to a module or function.\n\n```js\n/*\n@example\nvar msg = greeting();\n*/\nfunction greeting() {\n  return \"Hello!\";\n}\n```\n\n### @extends\n\nSets the base class for a class.\n\n```js\n/*\n@extends Widget\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\n(Yes, doctor should be support a convention for this.)\n\n### @private, @public\n\nDoctor's default rules assume that everything exported is public and everything\nelse is private.\n\nYou can explicitly set something to private to hide it in\ndoctor's default rules.\n\n```js\n/*\n@private\n*/\nmodule.exports._foo = function () {\n  return \"Don't use me. I'm not documented!\";\n}\n```\n\nYou can explicitly set something to public to force doctor to add it to the\nreport. For example, in some cases, you may export something (say, via a\nreturn value of a function) that doctor doesn't see as public. If you mark a\nconstructor as public, doctor will automatically add all methods of that class\nto the report as well.\n\n```js\n/*\nSecret constructor.\n\n@class Secret maker.\n\n@public\n*/\nfunction Secret() {\n}\n```\n\n### @signature\n\nThis allows documenting alternate signatures of a single function. For example,\na setter and getter can sometimes be the same function. The @signature parameter\nset the description for these signatures and allows overriding parameter \ndescriptions.\n\n```js\n/*\n@param name - Attribute name.\n*/\nfunction attr(name, value) {\n/*\n@signature Get attribute value.\n@param value - Attribute value.\n*/\n  if (typeof value === 'undefined') {\n\n  }\n/*\n@signature Set attribute value.\n*/\n}\n```\n\n### @copy\n\nThis allows copying the tags from another function in the case that one\nfunction shares parameters or descriptions with another function.\n\n```js\n/*\nCreate a TPS report.\n@param name - Author of the report.\n@param verbose - Add \n*/\nfunction createTpsReport(name, verbose) {\n  return {\n    name: name,\n    summary: \"I didn't get any cake.\"\n  }\n  if (verbose) {\n    console.log(\"wasting time...\");\n  }\n}\n\n/*\n@copy createTpsReprot\n*/\nfunction createVerboseTpsReport(name) {\n  createTpsReport(name, true);\n}\n```\n\n### @abstract\n\nReally? What, are you a Java programmer?\n\nFine, this marks a class as abstract.\n\n## Writing custom rules\n\nDoctor's default rules are useful for normal documentation tasks, but you can do\nall kinds of neat things by writing your own rules.\n\nA rules module should export an array of rules or an object with a \"rules\"\nproperty. If multiple rules match the same AST node type, then they will fire\nin the order in which they declare.\n\n### Transform rules\n\nTransform rules follow this pattern:\n\n```js\n{\n  type: 'define-function',\n  match: function (node) {\n    var name = node.nodes[0].value;\n    return name === 'foo';\n  },\n  transform: function (node, report) {\n    node.remove();\n  }\n}\n```\n\n__type__\n\nThis property should be a string specifying the AST node type or an array of\nnode types. Note that you can use pseudo-end node types, for which rules will\nfire after all descendent node rules have fired. For example, define-function\nhas a corresponding end-define-function which will fire after the entire body\nof the function has been processed.\n\n__match__ (optional)\n\nThis property is an optional function that can further filter the node.\n\n__transform__\n\nThis property is a function that is called to transform the node.\n\n### Report rules\n\nReport rules follow this pattern:\n\n```js\n{\n  type: 'define-function',\n  match: function (node) {\n    var name = node.nodes[0].value;\n    return name === 'foo';\n  },\n  report: function (node, report) {\n    var name = node.nodes[0].value;\n    return {\n      key: 'define-function:' + name,\n      name: name\n    }\n  }\n}\n```\n\n__type__\n\nThis property should be a string specifying the AST node type or an array of\nnode types. Note that you can use pseudo-end node types, for which rules will\nfire after all descendent node rules have fired. For example, define-function\nhas a corresponding end-define-function which will fire after the entire body\nof the function has been processed.\n\n__match__ (optional)\n\nThis property is an optional function that can further filter the node.\n\n__report__\n\nThis property is a function that manipulates the report, either via the report\nparameter or by returning a report item or an array of report items.\n\n## AST node types\n\nIf you write your own rules, you'll need to know the following AST node types.\n\nAs noted above, each AST node type has a corresponding end type. So\ndefine-function has a matching end-define-function.\n\n### files\n\nA group of all files. Rules for this node type (and the corresponding end-files)\nwill fire only once.\n\n### file\n\nEach file.\n\n### undefined\n\nUndefined node. For example: if an else clause of an if statement is\nundefined, the else clause will be an undefined node.\n\n### name\n\nAn identifier. For example: a function name, a variable name.\n\n### number\n\nA number. For example: 3, 5.6.\n\n### string\n\nA string. For example: \"hello\".\n\n### null\n\nA null literal.\n\n### boolean\n\nA boolean literal (true or false).\n\n### regex\n\nA literal regular expression.\n\n### regex-body\n\nThe body (between the slashes) of a regular expression.\n\n### regex-flags\n\nThe flags (after the second slash) of a regular expression.\n\n### this\n\nThe \"this\" keyword.\n\n### object\n\nA literal object.\n\n### property\n\nA key and value set of a literal object.\n\n### get\n\nGetter.\n\n### set\n\nSetter.\n\n### new\n\nUsing new to instantiate an object with a constructor.\n\n### dot\n\nUsing dot to access a property or method. For example: foo.bar, foo.baz().\n\n### call\n\nA function call.\n\n### subscript\n\nUsing brackets to access a property or index. For example: foo[0], foo[\"bar\"].\n\n### expression\n\nA parenthetical expression. For example: (3 + 5), (a || b).\n\n### postfix\n\nA postfix expression. For example: x--, i++.\n\n### operator\n\nThe operator used in an expression.\n\n### unary\n\nA unary prefix expression. For example: --x, ++i;\n\n### binary\n\nAn binary expression. For example: 3 + 5, a || b.\n\n### conditional\n\nA conditional expression.\n\n### assign\n\nAssignment of a value to a variable.\n\n### vars\n\nA group of variable declarations.\n\n### var\n\nA single variable declaration.\n\n### empty\n\nAn empty statment, which basically means a semicolon by itself.\n\n### if\n\nAn if statement.\n\n### do-while\n\nA do-while statement.\n\n### while\n\nA while statement.\n\n### for\n\nA for loop.\n\n### for-in\n\nA for-in loop.\n\n### continue\n\nA continue statement.\n\n### break\n\nA break statement.\n\n### return\n\nA return statement.\n\n### with\n\nA with statement.\n\n### switch\n\nA switch statement.\n\n### case\n\nA case statement of a switch statement.\n\n### default\n\nA default statement of a switch statement.\n\n### nodes\n\nA group of AST nodes, which is part of another node. For example, the body of a\nfunction is a node of type \"nodes\" containing all the nodes of the body.\n\n### labeled-statement\n\nA labeled statement.\n\n### throw\n\nA throw.\n\n### try\n\nA try.\n\n### catch\n\nA catch clause of a try.\n\n### finally\n\nA finally clause of a try.\n\n### debug\n\nA debugger statement.\n\n### define-function\n\nA function definition.\n\n### function\n\nA function expression.\n\n### parameters\n\nThe parameters of a function.\n\n## FAQ\n\n### Why did you do this? Don't you know [insert here] already exists.\n\nYeah, but [insert here] works off of comment tags and not off of coding\nconventions. And [insert here] doesn't make it easy to add new conventions. And\n[insert here] isn't a pure node module. And doctor aims to be a general purpose\ncode analysis tool.\n\n### Seriously, why did you do this?\n\nSome kind of OCD thing.\n\n### Why isn't this split into two projects, one for the analysis tool and another for code documentation?\n\nMaybe it should be. It grew up that way, and I haven't spent any thought or\neffort on splitting it.\n\n### Why is the code so ugly? What's with all these weird wrapping closures around fs and path?\n\nThat is thanks to synchronous require. I love node, but I hate synchronous\nrequire. (Yes, I understand why it's synchronous.) Because I wanted doctor to\nwork asynchronously or synchronously, I had to make asynchronous signatures for\nthe synchronous functions and then swap them out as needed.\n\nThe rest of the ugliness is my fault.\n\n### How do I contribute?\n\nThe usual: fork, add a (preferably discrete) fix/change with the necessary\ntests, and do a pull request. I can't promise to respond immediately or even in\na reasonable timeframe, but I'll do my best to eventually get to it.\n\n### Have these questions actually been frequently asked?\n\nNo, just being proactive.","_id":"doctor@0.2.1","dist":{"shasum":"7be378939ab6393a5a8b168531458de52c1a2a95","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.2.1.tgz","integrity":"sha512-LrSc4/wvD1w0n+VeZIbxE6MOQIeI5NTV3RiODZZvw29/ZSP8BQVOxuaf39+xXfgp966XOYpsUNlBbdRDXgO9/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuEKoi2URcFa3fzXRfXxAVrpj8rI63IBQ85vDUDI9a0wIhAJfWe8t2oyIGbxf/8ZekA/inbH7ztDSFvp4hS87ry/vx"}]},"_npmVersion":"1.1.62","_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.2.2":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from or otherwise analyze/transform JavaScript source.","version":"0.2.2","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":"~0.3.1","async":"~0.1.9","ncp":"=0.2.6","pegjs":"=0.6.2","handlebars":"~1.0.0","underscore":"~1.2.2","mkdirp":"~0.3.4","marked":"~0.2.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3","js-yaml":"~0.3.5"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__ It is probably stable enough to be useful, but no promises.\n\n![pinch](https://github.com/jdeal/doctor/raw/master/images/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/images/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a flat\nJSON object containing items and groups of items. The report is optionally run\nthrough a render module to convert the report to some format other than a single\nJSON file.\n\nDoctor also provides an option that takes a number of view directories and\nmerges them together into a single output directory, along with the report\nfile(s). A default HTML/JavaScript view is provided to view the default report\nas HTML.\n\nDoctor has initial (rough) support for markdown as well, integrating that into\nthe report if passed along with the source.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```bash\nnpm install doctor\n```\n\nor if you want the latest\n\n```bash\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nNote that these examples assume a shell that expands wildcards.\n\nThis is how doctor documents itself from the command-line:\n\n```bash\ndoctor lib/*.js *.md -v default -v doctor -o ../doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\nThe above command (when run from inside doctor's repository directory) takes all\nthe .js files and all the .md files and runs them through the default transform\nand default report rules. It puts the report into ../doc and merges the default\nand doctor views into ../doc. For many of doctor's options, it will look for a\nbuilt-in resource first and then try to find it in the directory provided. In\nthis example, doctor has views named default and doctor, so it finds them in\nitself. If an alternate view was provided, say my-view, it would look for that\npath, whether it be local or absolute.\n\nThese and other options are described in more detail in the command-line section\nbelow.\n\nYou can also look at the [examples](http://github.com/jdeal/doctor/tree/master/examples).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```bash\ndoctor myfile1.js myfile2.js\n```\n\nIf no output directory is provided, doctor will throw the report (or whatever is\nrequested, such as the raw AST) to the the console.\n\nTo write out the report file, give it a directory:\n\n```bash\ndoctor myfile1.js myfile2.js -o output\n```\n\nDoctor will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```bash\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nWhen doctor sees the .json extension like this, it assumes you mean to rename\nthe report.\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```bash\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```bash\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nThe default viewer files will be located in the output directory along with your\nreport.\n\nTo merge your own files into the view, pass multiple views:\n\n```bash\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nWhen multiple views are passed, they are processed in order. So, if a later view\ncan overwrite a previous view's files. This is useful when you want a view to\ndiffer only slightly. This is how doctor documents itself, by overriding the\nconfig file of the default view.\n\nYou can override the grammar if you feel adenturous:\n\n```bash\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nNote that the JavaScript grammar is pretty complicated, so you probably want to\nuse doctor's included grammar (in grammar/javascript.pegjs) as a starting point.\n\nYou can override the grammar for a specific file extension. This is necessary if\nyou want to alter the JavaScript grammar for .js while leaving the markdown\ngrammar registered for .md.\n\n```bash\ndoctor source.js readme.md --grammar.js ~/my-js-gramar.pegjs\n```\n\nYou can add your own transform rules:\n\n```bash\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nTransform rules are useful for modifying the AST prior to creating reports.\nThey're powerful, but also easy to mess up. Look at doctor's own transform rules\n(transform/default) for examples, or look in the examples directory for simpler\nexamples.\n\nPerhaps most important, you can add your own report rules:\n\n```bash\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nThis is what doctor is all about. You can look at doctor's own rules\n(report/default), but these are pretty complicated. Some simpler examples are\nin the examples directory.\n\nYou can also use a custom renderer:\n\n```bash\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\nThis allows you to modify the resulting JSON report or convert it to something\nelse entirely. Doctor's default renderer exists only to convert markdown to\nHTML. You'll also find a markdown renderer (default/markdown) which is meant\nto convert the JSON to markdown files, but this is not finished.\n\nBy default, doctor passes unknown JSDoc tags through to the report, but you can\nhave it complain if it sees unknown tags:\n\n```bash\ndoctor myfile1.js --no-unknown\n```\n\nAny of the default enabled options (grammar, transform, report, render, and\nunknown) can be disabled by prefixing the option with no-.\n\nYou can force doctor to return its AST like this:\n\n```bash\ndoctor myfile1.js --no-transform --no-report --ast\n```\n\nNotice that we turned of the transform and report rules in this example. We\ncould leave the transform rules enabled if we wanted to see the AST after\ntransformation. If we leave the report active, we'll get an object returned\nthat contains the AST and the report.\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: {js:\n    ['default', '~/more-report-rules.js']\n  },\n  render: 'default',\n  unknown: false,\n  output: '~/documentation'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\n## API\n\nFor writing transform and report rules, you'll need to learn doctor's API. You\ncan see doctor's own documentation for that:\n\nhttp://jdeal.github.com/doctor/doc\n\n## Conventions\n\nThe default rules supplied by doctor (report/default) will document the\nfollowing conventions in your code. (In this section, _doctor_ may refer to\ndoctor and its default rules.)\n\n### CommonJS modules\n\nDoctor only documents the public API, via CommonJS exports.\n\n```js\nexports.foo = function () {};\n```\n\n```js\nmodule.exports = {foo: function () {}}\n```\n\n```js\nmodule.exports = function () {}\n```\n\nNote that doctor can find many variations of the above patterns. For example,\nit can generally see when you're setting variables and then exporting those\nvariables, even if you're setting the variables to other required modules. If\ndoctor can't figure out what you're exporting, there's a good chance humans also\ncan't figure it out.\n\n### AMD modules\n\nDoctor sees AMD-style exports as well.\n\n```js\ndefine(function () {\n  return {foo: function () {}};\n});\n```\n\nAgain, it can see some variations of\nthis, although it may not be quite as resilient as node-style exports.\n\n### Function parameters\n\nOf course, doctor documents parameters of exported functions.\n\n```js\nfunction foo(bar) {}\n```\n\n### Optional parameters\n\nDoctor can see where a parameter is given a default value.\n\n```js\nfunction foo(bar) {\n  bar = bar || 'baz';\n}\n```\n\n### Constructors\n\nDoctor will assume upper-case functions are constructors.\n\n```js\nfunction Foo() {}\n\nmodule.exports = Foo;\n```\n\n### Instances\n\nDoctor can see when an instance is exported.\n\n```js\nfunction Foo() {}\n\nFoo.prototype.bar = function () {};\n\nmodule.exports = new Foo();\n```\n\nGiven that export, doctor knows your module has exported a function named bar.\n\n### Following dependencies\n\nDoctor can follow require.\n\n```js\nvar bar = require('./bar');\n\nexports.bar = bar;\n```\n\nAnd it can follow AMD dependencies.\n\n```js\ndefine(['./bar'], function (bar) {\n  return {bar: bar};\n});\n```\n\nNote that doctor will only document what is passed to it. It will not document\ndependent modules, except when they are exported from a passed-in module.\n\nSo, if the above code is part of foo.js, and you call doctor like this:\n\n```bash\ndoctor lib/foo.js\n```\n\nbar.js will not be documented, even though doctor follows it.\n\n### Literal prototypes\n\n```js\nfunction Foo() {\n}\n\nFoo.prototype = {\n  bar: function () {\n  }\n}\n```\n\n## JSDoc tags\n\nWhere doctor cannot infer documentation from convention, JSDoc tags can be used\nto annotate the code.\n\nNote that you can use multi-line or single-line comment style.\n\n### @description\n\nAdd a description to a function, using markdown.\n\n```js\n/*\n@description Returns a greeting.\n*/\nfunction hello() {\n  return \"Hello!\";\n}\n```\n\nIf a comment appears with no tag, it is assumed to be a description.\n\n```js\n/*\nReturns a greeting.\n*/\nfunction hello() {\n  return \"Hello!\";\n}\n```\n\n### @param\n\nAdd a description and optional type to a function parameter.\n\n```js\n/*\n@param {string} name - Name of a person.\n*/\nfunction greeting(name) {\n  return \"Hello, \" + name + \".\";\n}\n```\n\nNote the optional dash (-) which can be used to visually separate the\ndescription.\n\nNote that doctor will match the parameters to the name of the function. So a\nfunction like this:\n\n```js\n/*\n@param {number} y - The y, of course.\n*/\nfunction foo(x, y, z) {\n  return x * y + z;\n}\n```\n\nwill add a description to the y parameter. This is different from JSDoc which\nmatches the parameters by position.\n\nIf a parameter is an object with certain properties, you can document the\nproperties like this:\n\n```js\n/*\n@param {object} car - The car.\n@param {number} car.speed - The speed of the car.\n*/\nfunction drive(car) {\n  console.log(\"The car is going \" + car.speed + \"mph.\");\n}\n```\n\nIf a parameter is a function with certain parameters, you can document the\nparameters like this:\n\n```js\n/*\n@param {function(err, message)} callback - Function to call when finished.\n*/\nfunction waitAndThen(callback) {\n  setTimeout(function () {\n    callback(null, \"hello\");\n  }, 1000);\n}\n```\n\nNote that doctor's default view doesn't do anything except parrot these\nparameters, but they are available in the report.\n\nOptional parameters can be documented with brackets, and default values can be\ndocumented with an assignment.\n\n```js\n/*\n@param {string} [name = \"you\"] - Name of a person.\n*/\nfunction greeting(name) {\n  name = name || \"you\";\n  return \"Hello, \" + name + \".\";\n}\n```\n\nAs noted above though, this is unnecessary, as doctor can see the convention for\noptional parameters.\n\n### @return, @returns\n\nDocument the return type of a function.\n\n```js\n/*\n@returns string\n*/\nfunction foo() {\n  return \"bar\";\n}\n```\n\n### @class\n\nAdd a description for the class.\n\n```js\n/*\n@class A useful widget.\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\n### @constructor\n\nAdd a description for the constructor.\n\n```js\n/*\n@constructor Makes a widget.\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\nThis is not really necessary since doctor sees upper-case functions as\nconstructors. In doctors default view, the constructor description just gets\nconcatenated to the description.\n\n### @example\n\nAdds example usage to a module or function.\n\n```js\n/*\n@example\nvar msg = greeting();\n*/\nfunction greeting() {\n  return \"Hello!\";\n}\n```\n\n### @extends\n\nSets the base class for a class.\n\n```js\n/*\n@extends Widget\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\n(Yes, doctor should be support a convention for this.)\n\n### @private, @public\n\nDoctor's default rules assume that everything exported is public and everything\nelse is private.\n\nYou can explicitly set something to private to hide it in\ndoctor's default rules.\n\n```js\n/*\n@private\n*/\nmodule.exports._foo = function () {\n  return \"Don't use me. I'm not documented!\";\n}\n```\n\nYou can explicitly set something to public to force doctor to add it to the\nreport. For example, in some cases, you may export something (say, via a\nreturn value of a function) that doctor doesn't see as public. If you mark a\nconstructor as public, doctor will automatically add all methods of that class\nto the report as well.\n\n```js\n/*\nSecret constructor.\n\n@class Secret maker.\n\n@public\n*/\nfunction Secret() {\n}\n```\n\n### @signature\n\nThis allows documenting alternate signatures of a single function. For example,\na setter and getter can sometimes be the same function. The @signature parameter\nset the description for these signatures and allows overriding parameter \ndescriptions.\n\n```js\n/*\n@param name - Attribute name.\n*/\nfunction attr(name, value) {\n/*\n@signature Get attribute value.\n@param value - Attribute value.\n*/\n  if (typeof value === 'undefined') {\n\n  }\n/*\n@signature Set attribute value.\n*/\n}\n```\n\n### @copy\n\nThis allows copying the tags from another function in the case that one\nfunction shares parameters or descriptions with another function.\n\n```js\n/*\nCreate a TPS report.\n@param name - Author of the report.\n@param verbose - Add \n*/\nfunction createTpsReport(name, verbose) {\n  return {\n    name: name,\n    summary: \"I didn't get any cake.\"\n  }\n  if (verbose) {\n    console.log(\"wasting time...\");\n  }\n}\n\n/*\n@copy createTpsReprot\n*/\nfunction createVerboseTpsReport(name) {\n  createTpsReport(name, true);\n}\n```\n\n### @abstract\n\nReally? What, are you a Java programmer?\n\nFine, this marks a class as abstract.\n\n## Writing custom rules\n\nDoctor's default rules are useful for normal documentation tasks, but you can do\nall kinds of neat things by writing your own rules.\n\nA rules module should export an array of rules or an object with a \"rules\"\nproperty. If multiple rules match the same AST node type, then they will fire\nin the order in which they declare.\n\n### Transform rules\n\nTransform rules follow this pattern:\n\n```js\n{\n  type: 'define-function',\n  match: function (node) {\n    var name = node.nodes[0].value;\n    return name === 'foo';\n  },\n  transform: function (node, report) {\n    node.remove();\n  }\n}\n```\n\n__type__\n\nThis property should be a string specifying the AST node type or an array of\nnode types. Note that you can use pseudo-end node types, for which rules will\nfire after all descendent node rules have fired. For example, define-function\nhas a corresponding end-define-function which will fire after the entire body\nof the function has been processed.\n\n__match__ (optional)\n\nThis property is an optional function that can further filter the node.\n\n__transform__\n\nThis property is a function that is called to transform the node.\n\n### Report rules\n\nReport rules follow this pattern:\n\n```js\n{\n  type: 'define-function',\n  match: function (node) {\n    var name = node.nodes[0].value;\n    return name === 'foo';\n  },\n  report: function (node, report) {\n    var name = node.nodes[0].value;\n    return {\n      key: 'define-function:' + name,\n      name: name\n    }\n  }\n}\n```\n\n__type__\n\nThis property should be a string specifying the AST node type or an array of\nnode types. Note that you can use pseudo-end node types, for which rules will\nfire after all descendent node rules have fired. For example, define-function\nhas a corresponding end-define-function which will fire after the entire body\nof the function has been processed.\n\n__match__ (optional)\n\nThis property is an optional function that can further filter the node.\n\n__report__\n\nThis property is a function that manipulates the report, either via the report\nparameter or by returning a report item or an array of report items.\n\n## AST node types\n\nIf you write your own rules, you'll need to know the following AST node types.\n\nAs noted above, each AST node type has a corresponding end type. So\ndefine-function has a matching end-define-function.\n\n### files\n\nA group of all files. Rules for this node type (and the corresponding end-files)\nwill fire only once.\n\n### file\n\nEach file.\n\n### undefined\n\nUndefined node. For example: if an else clause of an if statement is\nundefined, the else clause will be an undefined node.\n\n### name\n\nAn identifier. For example: a function name, a variable name.\n\n### number\n\nA number. For example: 3, 5.6.\n\n### string\n\nA string. For example: \"hello\".\n\n### null\n\nA null literal.\n\n### boolean\n\nA boolean literal (true or false).\n\n### regex\n\nA literal regular expression.\n\n### regex-body\n\nThe body (between the slashes) of a regular expression.\n\n### regex-flags\n\nThe flags (after the second slash) of a regular expression.\n\n### this\n\nThe \"this\" keyword.\n\n### object\n\nA literal object.\n\n### property\n\nA key and value set of a literal object.\n\n### get\n\nGetter.\n\n### set\n\nSetter.\n\n### new\n\nUsing new to instantiate an object with a constructor.\n\n### dot\n\nUsing dot to access a property or method. For example: foo.bar, foo.baz().\n\n### call\n\nA function call.\n\n### subscript\n\nUsing brackets to access a property or index. For example: foo[0], foo[\"bar\"].\n\n### expression\n\nA parenthetical expression. For example: (3 + 5), (a || b).\n\n### postfix\n\nA postfix expression. For example: x--, i++.\n\n### operator\n\nThe operator used in an expression.\n\n### unary\n\nA unary prefix expression. For example: --x, ++i;\n\n### binary\n\nAn binary expression. For example: 3 + 5, a || b.\n\n### conditional\n\nA conditional expression.\n\n### assign\n\nAssignment of a value to a variable.\n\n### vars\n\nA group of variable declarations.\n\n### var\n\nA single variable declaration.\n\n### empty\n\nAn empty statment, which basically means a semicolon by itself.\n\n### if\n\nAn if statement.\n\n### do-while\n\nA do-while statement.\n\n### while\n\nA while statement.\n\n### for\n\nA for loop.\n\n### for-in\n\nA for-in loop.\n\n### continue\n\nA continue statement.\n\n### break\n\nA break statement.\n\n### return\n\nA return statement.\n\n### with\n\nA with statement.\n\n### switch\n\nA switch statement.\n\n### case\n\nA case statement of a switch statement.\n\n### default\n\nA default statement of a switch statement.\n\n### nodes\n\nA group of AST nodes, which is part of another node. For example, the body of a\nfunction is a node of type \"nodes\" containing all the nodes of the body.\n\n### labeled-statement\n\nA labeled statement.\n\n### throw\n\nA throw.\n\n### try\n\nA try.\n\n### catch\n\nA catch clause of a try.\n\n### finally\n\nA finally clause of a try.\n\n### debug\n\nA debugger statement.\n\n### define-function\n\nA function definition.\n\n### function\n\nA function expression.\n\n### parameters\n\nThe parameters of a function.\n\n## FAQ\n\n### Why did you do this? Don't you know [insert here] already exists.\n\nYeah, but [insert here] works off of comment tags and not off of coding\nconventions. And [insert here] doesn't make it easy to add new conventions. And\n[insert here] isn't a pure node module. And doctor aims to be a general purpose\ncode analysis tool.\n\n### Seriously, why did you do this?\n\nSome kind of OCD thing.\n\n### Why isn't this split into two projects, one for the analysis tool and another for code documentation?\n\nMaybe it should be. It grew up that way, and I haven't spent any thought or\neffort on splitting it.\n\n### Why is the code so ugly? What's with all these weird wrapping closures around fs and path?\n\nThat is thanks to synchronous require. I love node, but I hate synchronous\nrequire. (Yes, I understand why it's synchronous.) Because I wanted doctor to\nwork asynchronously or synchronously, I had to make asynchronous signatures for\nthe synchronous functions and then swap them out as needed.\n\nThe rest of the ugliness is my fault.\n\n### How do I contribute?\n\nThe usual: fork, add a (preferably discrete) fix/change with the necessary\ntests, and do a pull request. I can't promise to respond immediately or even in\na reasonable timeframe, but I'll do my best to eventually get to it.\n\n### Have these questions actually been frequently asked?\n\nNo, just being proactive.","_id":"doctor@0.2.2","dist":{"shasum":"d43f9d6a9c74aa9a9a1e5a09e6041a674722de66","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.2.2.tgz","integrity":"sha512-EsLID3tpVMxLEILRlTzK2WCsrMZcxcBHhg07g0I9GnWrXIhJlaBDrRz/GdsL5GpvQeXZMJ1luSgLGdeCgmvxgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICeeAPSM65ttenLN9ZdDDcPJJ2uTC9IEi8ntxGGOiGyDAiEAvRHwt4MsWQjz3HTuachia5V0KQNe/HSHLci7uFyTqBI="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.2.3":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from or otherwise analyze/transform JavaScript source.","version":"0.2.3","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","engines":{"node":">= 0.4.12"},"dependencies":{"optimist":"~0.3.1","async":"~0.1.9","ncp":"=0.2.6","pegjs":"=0.6.2","handlebars":"~1.0.0","underscore":"~1.2.2","mkdirp":"~0.3.4","marked":"~0.2.5"},"devDependencies":{"mocha":">=0.12.1","chai":">=0.3.3","js-yaml":"~0.3.5"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\n__Doctor is still under development, so be careful.__ It is probably stable enough to be useful, but no promises.\n\n![pinch](https://github.com/jdeal/doctor/raw/master/images/pinch-points-warning-143.png)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/images/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a flat\nJSON object containing items and groups of items. The report is optionally run\nthrough a render module to convert the report to some format other than a single\nJSON file.\n\nDoctor also provides an option that takes a number of view directories and\nmerges them together into a single output directory, along with the report\nfile(s). A default HTML/JavaScript view is provided to view the default report\nas HTML.\n\nDoctor has initial (rough) support for markdown as well, integrating that into\nthe report if passed along with the source.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```bash\nnpm install doctor\n```\n\nor if you want the latest\n\n```bash\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nNote that these examples assume a shell that expands wildcards.\n\nThis is how doctor documents itself from the command-line:\n\n```bash\ndoctor lib/*.js *.md -v default -v doctor -o ../doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\nThe above command (when run from inside doctor's repository directory) takes all\nthe .js files and all the .md files and runs them through the default transform\nand default report rules. It puts the report into ../doc and merges the default\nand doctor views into ../doc. For many of doctor's options, it will look for a\nbuilt-in resource first and then try to find it in the directory provided. In\nthis example, doctor has views named default and doctor, so it finds them in\nitself. If an alternate view was provided, say my-view, it would look for that\npath, whether it be local or absolute.\n\nThese and other options are described in more detail in the command-line section\nbelow.\n\nYou can also look at the [examples](http://github.com/jdeal/doctor/tree/master/examples).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```bash\ndoctor myfile1.js myfile2.js\n```\n\nIf no output directory is provided, doctor will throw the report (or whatever is\nrequested, such as the raw AST) to the the console.\n\nTo write out the report file, give it a directory:\n\n```bash\ndoctor myfile1.js myfile2.js -o output\n```\n\nDoctor will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```bash\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nWhen doctor sees the .json extension like this, it assumes you mean to rename\nthe report.\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```bash\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```bash\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nThe default viewer files will be located in the output directory along with your\nreport.\n\nTo merge your own files into the view, pass multiple views:\n\n```bash\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nWhen multiple views are passed, they are processed in order. So, if a later view\ncan overwrite a previous view's files. This is useful when you want a view to\ndiffer only slightly. This is how doctor documents itself, by overriding the\nconfig file of the default view.\n\nYou can override the grammar if you feel adenturous:\n\n```bash\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nNote that the JavaScript grammar is pretty complicated, so you probably want to\nuse doctor's included grammar (in grammar/javascript.pegjs) as a starting point.\n\nYou can override the grammar for a specific file extension. This is necessary if\nyou want to alter the JavaScript grammar for .js while leaving the markdown\ngrammar registered for .md.\n\n```bash\ndoctor source.js readme.md --grammar.js ~/my-js-gramar.pegjs\n```\n\nYou can add your own transform rules:\n\n```bash\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nTransform rules are useful for modifying the AST prior to creating reports.\nThey're powerful, but also easy to mess up. Look at doctor's own transform rules\n(transform/default) for examples, or look in the examples directory for simpler\nexamples.\n\nPerhaps most important, you can add your own report rules:\n\n```bash\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nThis is what doctor is all about. You can look at doctor's own rules\n(report/default), but these are pretty complicated. Some simpler examples are\nin the examples directory.\n\nYou can also use a custom renderer:\n\n```bash\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\nThis allows you to modify the resulting JSON report or convert it to something\nelse entirely. Doctor's default renderer exists only to convert markdown to\nHTML. You'll also find a markdown renderer (default/markdown) which is meant\nto convert the JSON to markdown files, but this is not finished.\n\nBy default, doctor passes unknown JSDoc tags through to the report, but you can\nhave it complain if it sees unknown tags:\n\n```bash\ndoctor myfile1.js --no-unknown\n```\n\nAny of the default enabled options (grammar, transform, report, render, and\nunknown) can be disabled by prefixing the option with no-.\n\nYou can force doctor to return its AST like this:\n\n```bash\ndoctor myfile1.js --no-transform --no-report --ast\n```\n\nNotice that we turned of the transform and report rules in this example. We\ncould leave the transform rules enabled if we wanted to see the AST after\ntransformation. If we leave the report active, we'll get an object returned\nthat contains the AST and the report.\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: {js:\n    ['default', '~/more-report-rules.js']\n  },\n  render: 'default',\n  unknown: false,\n  output: '~/documentation'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\n## API\n\nFor writing transform and report rules, you'll need to learn doctor's API. You\ncan see doctor's own documentation for that:\n\nhttp://jdeal.github.com/doctor/doc\n\n## Conventions\n\nThe default rules supplied by doctor (report/default) will document the\nfollowing conventions in your code. (In this section, _doctor_ may refer to\ndoctor and its default rules.)\n\n### CommonJS modules\n\nDoctor only documents the public API, via CommonJS exports.\n\n```js\nexports.foo = function () {};\n```\n\n```js\nmodule.exports = {foo: function () {}}\n```\n\n```js\nmodule.exports = function () {}\n```\n\nNote that doctor can find many variations of the above patterns. For example,\nit can generally see when you're setting variables and then exporting those\nvariables, even if you're setting the variables to other required modules. If\ndoctor can't figure out what you're exporting, there's a good chance humans also\ncan't figure it out.\n\n### AMD modules\n\nDoctor sees AMD-style exports as well.\n\n```js\ndefine(function () {\n  return {foo: function () {}};\n});\n```\n\nAgain, it can see some variations of\nthis, although it may not be quite as resilient as node-style exports.\n\n### Function parameters\n\nOf course, doctor documents parameters of exported functions.\n\n```js\nfunction foo(bar) {}\n```\n\n### Optional parameters\n\nDoctor can see where a parameter is given a default value.\n\n```js\nfunction foo(bar) {\n  bar = bar || 'baz';\n}\n```\n\n### Constructors\n\nDoctor will assume upper-case functions are constructors.\n\n```js\nfunction Foo() {}\n\nmodule.exports = Foo;\n```\n\n### Instances\n\nDoctor can see when an instance is exported.\n\n```js\nfunction Foo() {}\n\nFoo.prototype.bar = function () {};\n\nmodule.exports = new Foo();\n```\n\nGiven that export, doctor knows your module has exported a function named bar.\n\n### Following dependencies\n\nDoctor can follow require.\n\n```js\nvar bar = require('./bar');\n\nexports.bar = bar;\n```\n\nAnd it can follow AMD dependencies.\n\n```js\ndefine(['./bar'], function (bar) {\n  return {bar: bar};\n});\n```\n\nNote that doctor will only document what is passed to it. It will not document\ndependent modules, except when they are exported from a passed-in module.\n\nSo, if the above code is part of foo.js, and you call doctor like this:\n\n```bash\ndoctor lib/foo.js\n```\n\nbar.js will not be documented, even though doctor follows it.\n\n### Literal prototypes\n\n```js\nfunction Foo() {\n}\n\nFoo.prototype = {\n  bar: function () {\n  }\n}\n```\n\n## JSDoc tags\n\nWhere doctor cannot infer documentation from convention, JSDoc tags can be used\nto annotate the code.\n\nNote that you can use multi-line or single-line comment style.\n\n### @description\n\nAdd a description to a function, using markdown.\n\n```js\n/*\n@description Returns a greeting.\n*/\nfunction hello() {\n  return \"Hello!\";\n}\n```\n\nIf a comment appears with no tag, it is assumed to be a description.\n\n```js\n/*\nReturns a greeting.\n*/\nfunction hello() {\n  return \"Hello!\";\n}\n```\n\n### @param\n\nAdd a description and optional type to a function parameter.\n\n```js\n/*\n@param {string} name - Name of a person.\n*/\nfunction greeting(name) {\n  return \"Hello, \" + name + \".\";\n}\n```\n\nNote the optional dash (-) which can be used to visually separate the\ndescription.\n\nNote that doctor will match the parameters to the name of the function. So a\nfunction like this:\n\n```js\n/*\n@param {number} y - The y, of course.\n*/\nfunction foo(x, y, z) {\n  return x * y + z;\n}\n```\n\nwill add a description to the y parameter. This is different from JSDoc which\nmatches the parameters by position.\n\nIf a parameter is an object with certain properties, you can document the\nproperties like this:\n\n```js\n/*\n@param {object} car - The car.\n@param {number} car.speed - The speed of the car.\n*/\nfunction drive(car) {\n  console.log(\"The car is going \" + car.speed + \"mph.\");\n}\n```\n\nIf a parameter is a function with certain parameters, you can document the\nparameters like this:\n\n```js\n/*\n@param {function(err, message)} callback - Function to call when finished.\n*/\nfunction waitAndThen(callback) {\n  setTimeout(function () {\n    callback(null, \"hello\");\n  }, 1000);\n}\n```\n\nNote that doctor's default view doesn't do anything except parrot these\nparameters, but they are available in the report.\n\nOptional parameters can be documented with brackets, and default values can be\ndocumented with an assignment.\n\n```js\n/*\n@param {string} [name = \"you\"] - Name of a person.\n*/\nfunction greeting(name) {\n  name = name || \"you\";\n  return \"Hello, \" + name + \".\";\n}\n```\n\nAs noted above though, this is unnecessary, as doctor can see the convention for\noptional parameters.\n\n### @return, @returns\n\nDocument the return type of a function.\n\n```js\n/*\n@returns string\n*/\nfunction foo() {\n  return \"bar\";\n}\n```\n\n### @class\n\nAdd a description for the class.\n\n```js\n/*\n@class A useful widget.\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\n### @constructor\n\nAdd a description for the constructor.\n\n```js\n/*\n@constructor Makes a widget.\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\nThis is not really necessary since doctor sees upper-case functions as\nconstructors. In doctors default view, the constructor description just gets\nconcatenated to the description.\n\n### @example\n\nAdds example usage to a module or function.\n\n```js\n/*\n@example\nvar msg = greeting();\n*/\nfunction greeting() {\n  return \"Hello!\";\n}\n```\n\n### @extends\n\nSets the base class for a class.\n\n```js\n/*\n@extends Widget\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\n(Yes, doctor should be support a convention for this.)\n\n### @private, @public\n\nDoctor's default rules assume that everything exported is public and everything\nelse is private.\n\nYou can explicitly set something to private to hide it in\ndoctor's default rules.\n\n```js\n/*\n@private\n*/\nmodule.exports._foo = function () {\n  return \"Don't use me. I'm not documented!\";\n}\n```\n\nYou can explicitly set something to public to force doctor to add it to the\nreport. For example, in some cases, you may export something (say, via a\nreturn value of a function) that doctor doesn't see as public. If you mark a\nconstructor as public, doctor will automatically add all methods of that class\nto the report as well.\n\n```js\n/*\nSecret constructor.\n\n@class Secret maker.\n\n@public\n*/\nfunction Secret() {\n}\n```\n\n### @signature\n\nThis allows documenting alternate signatures of a single function. For example,\na setter and getter can sometimes be the same function. The @signature parameter\nset the description for these signatures and allows overriding parameter \ndescriptions.\n\n```js\n/*\n@param name - Attribute name.\n*/\nfunction attr(name, value) {\n/*\n@signature Get attribute value.\n@param value - Attribute value.\n*/\n  if (typeof value === 'undefined') {\n\n  }\n/*\n@signature Set attribute value.\n*/\n}\n```\n\n### @copy\n\nThis allows copying the tags from another function in the case that one\nfunction shares parameters or descriptions with another function.\n\n```js\n/*\nCreate a TPS report.\n@param name - Author of the report.\n@param verbose - Add \n*/\nfunction createTpsReport(name, verbose) {\n  return {\n    name: name,\n    summary: \"I didn't get any cake.\"\n  }\n  if (verbose) {\n    console.log(\"wasting time...\");\n  }\n}\n\n/*\n@copy createTpsReprot\n*/\nfunction createVerboseTpsReport(name) {\n  createTpsReport(name, true);\n}\n```\n\n### @abstract\n\nReally? What, are you a Java programmer?\n\nFine, this marks a class as abstract.\n\n## Writing custom rules\n\nDoctor's default rules are useful for normal documentation tasks, but you can do\nall kinds of neat things by writing your own rules.\n\nA rules module should export an array of rules or an object with a \"rules\"\nproperty. If multiple rules match the same AST node type, then they will fire\nin the order in which they declare.\n\n### Transform rules\n\nTransform rules follow this pattern:\n\n```js\n{\n  type: 'define-function',\n  match: function (node) {\n    var name = node.nodes[0].value;\n    return name === 'foo';\n  },\n  transform: function (node, report) {\n    node.remove();\n  }\n}\n```\n\n__type__\n\nThis property should be a string specifying the AST node type or an array of\nnode types. Note that you can use pseudo-end node types, for which rules will\nfire after all descendent node rules have fired. For example, define-function\nhas a corresponding end-define-function which will fire after the entire body\nof the function has been processed.\n\n__match__ (optional)\n\nThis property is an optional function that can further filter the node.\n\n__transform__\n\nThis property is a function that is called to transform the node.\n\n### Report rules\n\nReport rules follow this pattern:\n\n```js\n{\n  type: 'define-function',\n  match: function (node) {\n    var name = node.nodes[0].value;\n    return name === 'foo';\n  },\n  report: function (node, report) {\n    var name = node.nodes[0].value;\n    return {\n      key: 'define-function:' + name,\n      name: name\n    }\n  }\n}\n```\n\n__type__\n\nThis property should be a string specifying the AST node type or an array of\nnode types. Note that you can use pseudo-end node types, for which rules will\nfire after all descendent node rules have fired. For example, define-function\nhas a corresponding end-define-function which will fire after the entire body\nof the function has been processed.\n\n__match__ (optional)\n\nThis property is an optional function that can further filter the node.\n\n__report__\n\nThis property is a function that manipulates the report, either via the report\nparameter or by returning a report item or an array of report items.\n\n## AST node types\n\nIf you write your own rules, you'll need to know the following AST node types.\n\nAs noted above, each AST node type has a corresponding end type. So\ndefine-function has a matching end-define-function.\n\n### files\n\nA group of all files. Rules for this node type (and the corresponding end-files)\nwill fire only once.\n\n### file\n\nEach file.\n\n### undefined\n\nUndefined node. For example: if an else clause of an if statement is\nundefined, the else clause will be an undefined node.\n\n### name\n\nAn identifier. For example: a function name, a variable name.\n\n### number\n\nA number. For example: 3, 5.6.\n\n### string\n\nA string. For example: \"hello\".\n\n### null\n\nA null literal.\n\n### boolean\n\nA boolean literal (true or false).\n\n### regex\n\nA literal regular expression.\n\n### regex-body\n\nThe body (between the slashes) of a regular expression.\n\n### regex-flags\n\nThe flags (after the second slash) of a regular expression.\n\n### this\n\nThe \"this\" keyword.\n\n### object\n\nA literal object.\n\n### property\n\nA key and value set of a literal object.\n\n### get\n\nGetter.\n\n### set\n\nSetter.\n\n### new\n\nUsing new to instantiate an object with a constructor.\n\n### dot\n\nUsing dot to access a property or method. For example: foo.bar, foo.baz().\n\n### call\n\nA function call.\n\n### subscript\n\nUsing brackets to access a property or index. For example: foo[0], foo[\"bar\"].\n\n### expression\n\nA parenthetical expression. For example: (3 + 5), (a || b).\n\n### postfix\n\nA postfix expression. For example: x--, i++.\n\n### operator\n\nThe operator used in an expression.\n\n### unary\n\nA unary prefix expression. For example: --x, ++i;\n\n### binary\n\nAn binary expression. For example: 3 + 5, a || b.\n\n### conditional\n\nA conditional expression.\n\n### assign\n\nAssignment of a value to a variable.\n\n### vars\n\nA group of variable declarations.\n\n### var\n\nA single variable declaration.\n\n### empty\n\nAn empty statment, which basically means a semicolon by itself.\n\n### if\n\nAn if statement.\n\n### do-while\n\nA do-while statement.\n\n### while\n\nA while statement.\n\n### for\n\nA for loop.\n\n### for-in\n\nA for-in loop.\n\n### continue\n\nA continue statement.\n\n### break\n\nA break statement.\n\n### return\n\nA return statement.\n\n### with\n\nA with statement.\n\n### switch\n\nA switch statement.\n\n### case\n\nA case statement of a switch statement.\n\n### default\n\nA default statement of a switch statement.\n\n### nodes\n\nA group of AST nodes, which is part of another node. For example, the body of a\nfunction is a node of type \"nodes\" containing all the nodes of the body.\n\n### labeled-statement\n\nA labeled statement.\n\n### throw\n\nA throw.\n\n### try\n\nA try.\n\n### catch\n\nA catch clause of a try.\n\n### finally\n\nA finally clause of a try.\n\n### debug\n\nA debugger statement.\n\n### define-function\n\nA function definition.\n\n### function\n\nA function expression.\n\n### parameters\n\nThe parameters of a function.\n\n## FAQ\n\n### Why did you do this? Don't you know [insert here] already exists.\n\nYeah, but [insert here] works off of comment tags and not off of coding\nconventions. And [insert here] doesn't make it easy to add new conventions. And\n[insert here] isn't a pure node module. And doctor aims to be a general purpose\ncode analysis tool.\n\n### Seriously, why did you do this?\n\nSome kind of OCD thing.\n\n### Why isn't this split into two projects, one for the analysis tool and another for code documentation?\n\nMaybe it should be. It grew up that way, and I haven't spent any thought or\neffort on splitting it.\n\n### Why is the code so ugly? What's with all these weird wrapping closures around fs and path?\n\nThat is thanks to synchronous require. I love node, but I hate synchronous\nrequire. (Yes, I understand why it's synchronous.) Because I wanted doctor to\nwork asynchronously or synchronously, I had to make asynchronous signatures for\nthe synchronous functions and then swap them out as needed.\n\nThe rest of the ugliness is my fault.\n\n### How do I contribute?\n\nThe usual: fork, add a (preferably discrete) fix/change with the necessary\ntests, and do a pull request. I can't promise to respond immediately or even in\na reasonable timeframe, but I'll do my best to eventually get to it.\n\n### Have these questions actually been frequently asked?\n\nNo, just being proactive.","_id":"doctor@0.2.3","dist":{"shasum":"8d01afaab3c630def4bb312b1885ad9e1850b6f7","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.2.3.tgz","integrity":"sha512-YI+yImqKwdgDRhAkJP0+5mAQYYRxWdaqJX+YDMtAE8HgTMZWt22Bu70tXbZm8fn9uZnwIs3b26lyOfzHs/6Cng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTxI3MW2jYQn99+ltp4kaGmusbYeVXdF8M4VpL4ylR+gIgItgX8Vnh9YJ3lv5H+FjhCGkwWue5N3uPgcQhlcyi+UU="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]},"0.3.0":{"author":{"name":"Justin Deal"},"name":"doctor","description":"Create documentation from or otherwise analyze/transform JavaScript source.","version":"0.3.0","homepage":"https://github.com/jdeal/doctor","repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"main":"lib/doctor","dependencies":{"optimist":"~0.3.1","async":"~0.2.9","ncp":"=0.4.2","handlebars":"~1.0.0","underscore":"~1.2.2","mkdirp":"=0.3.4","marked":"=0.2.5","fs-compare":"=0.0.4","quickpeg":"=0.0.3"},"devDependencies":{"mocha":"=0.12.1","chai":"=0.3.3","js-yaml":"=0.3.5"},"bin":{"doctor":"bin/doctor"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/*.js -u qunit -R spec -t 20000"},"readme":"# doctor\n\n[![Build Status](https://secure.travis-ci.org/jdeal/doctor.png)](http://travis-ci.org/jdeal/doctor)\n\nDoctor converts JavaScript source to documentation, using rules to rely on\nconventions so that comment tags are (mostly) not needed.\n\n## Say what?\n\nMaybe a picture will help:\n\n![pipeline](https://github.com/jdeal/doctor/raw/master/images/doctor-pipeline.png)\n\nOkay, maybe that needs some explanation.\n\nSource files are parsed using a JavaScript grammar. This pushes out a plain\nLisp-like AST. This is refined with some transform rules. The default transform\nrules also use a grammar to parse the JSDoc-style comment tags. This is to add\nin things that cannot be inferred from the JavaScript source, such as function\ndescription and parameter types.\n\nRules are applied to the refined AST to output a report, which is just a flat\nJSON object containing items and groups of items. The report is optionally run\nthrough a render module to convert the report to some format other than a single\nJSON file.\n\nDoctor also provides an option that takes a number of view directories and\nmerges them together into a single output directory, along with the report\nfile(s). A default HTML/JavaScript view is provided to view the default report\nas HTML.\n\nDoctor has initial (rough) support for markdown as well, integrating that into\nthe report if passed along with the source.\n\nBecause of its modular and somewhat pluggable design, you can hack in your own\ngrammars, rules, etc. and use it as a general-purpose AST analysis tool.\n\n## Installation\n\n```bash\nnpm install doctor\n```\n\nor if you want the latest\n\n```bash\nnpm install git:github.com/jdeal/doctor.git\n```\n\n## Examples, please!\n\nNote that these examples assume a shell that expands wildcards.\n\nThis is how doctor documents itself from the command-line:\n\n```bash\ndoctor lib/*.js *.md -v default -v doctor -o ../doc\n```\n\nYou can see the documentation [here](http://jdeal.github.com/doctor/doc).\n\nThe above command (when run from inside doctor's repository directory) takes all\nthe .js files and all the .md files and runs them through the default transform\nand default report rules. It puts the report into ../doc and merges the default\nand doctor views into ../doc. For many of doctor's options, it will look for a\nbuilt-in resource first and then try to find it in the directory provided. In\nthis example, doctor has views named default and doctor, so it finds them in\nitself. If an alternate view was provided, say my-view, it would look for that\npath, whether it be local or absolute.\n\nThese and other options are described in more detail in the command-line section\nbelow.\n\nYou can also look at the [examples](http://github.com/jdeal/doctor/tree/master/examples).\n\n## Command-line usage\n\nDump a report file to the console:\n\n```bash\ndoctor myfile1.js myfile2.js\n```\n\nIf no output directory is provided, doctor will throw the report (or whatever is\nrequested, such as the raw AST) to the the console.\n\nTo write out the report file, give it a directory:\n\n```bash\ndoctor myfile1.js myfile2.js -o output\n```\n\nDoctor will write the report to a file named report.json. If you prefer a\ndifferent name:\n\n```bash\ndoctor myfile1.js myfile2.js -o output/myreport.json\n```\n\nWhen doctor sees the .json extension like this, it assumes you mean to rename\nthe report.\n\nYou can also pass package.json files to doctor. It will use the main property to\nfind the source file:\n\n```bash\ndoctor package.json -o output\n```\n\nTo output the default viewer along with your report:\n\n```bash\ndoctor myfile1.js myfile2.js -o output -v default\n```\n\nThe default viewer files will be located in the output directory along with your\nreport.\n\nTo merge your own files into the view, pass multiple views:\n\n```bash\ndoctor myfile1.js myfile2.js -o output -v default -v ~/my-view\n```\n\nWhen multiple views are passed, they are processed in order. So, if a later view\ncan overwrite a previous view's files. This is useful when you want a view to\ndiffer only slightly. This is how doctor documents itself, by overriding the\nconfig file of the default view.\n\nYou can override the grammar if you feel adenturous:\n\n```bash\ndoctor myfile1.js myfile2.js --grammar ~/my-better-grammar.pegjs\n```\n\nNote that the JavaScript grammar is pretty complicated, so you probably want to\nuse doctor's included grammar (in grammar/javascript.pegjs) as a starting point.\n\nYou can override the grammar for a specific file extension. This is necessary if\nyou want to alter the JavaScript grammar for .js while leaving the markdown\ngrammar registered for .md.\n\n```bash\ndoctor source.js readme.md --grammar.js ~/my-js-gramar.pegjs\n```\n\nYou can add your own transform rules:\n\n```bash\ndoctor myfile1.js myfile2.js -t default -t ~/more-tranform-rules.js\n```\n\nTransform rules are useful for modifying the AST prior to creating reports.\nThey're powerful, but also easy to mess up. Look at doctor's own transform rules\n(transform/default) for examples, or look in the examples directory for simpler\nexamples.\n\nPerhaps most important, you can add your own report rules:\n\n```bash\ndoctor myfile1.js myfile2.js -r default -r ~/more-report-rules.js\n```\n\nThis is what doctor is all about. You can look at doctor's own rules\n(report/default), but these are pretty complicated. Some simpler examples are\nin the examples directory.\n\nYou can also use a custom renderer:\n\n```bash\ndoctor myfile1.js myfile2.js --render ~/my-render.js\n```\n\nThis allows you to modify the resulting JSON report or convert it to something\nelse entirely. Doctor's default renderer exists only to convert markdown to\nHTML. You'll also find a markdown renderer (default/markdown) which is meant\nto convert the JSON to markdown files, but this is not finished.\n\nBy default, doctor passes unknown JSDoc tags through to the report, but you can\nhave it complain if it sees unknown tags:\n\n```bash\ndoctor myfile1.js --no-unknown\n```\n\nAny of the default enabled options (grammar, transform, report, render, and\nunknown) can be disabled by prefixing the option with no-.\n\nYou can force doctor to return its AST like this:\n\n```bash\ndoctor myfile1.js --no-transform --no-report --ast\n```\n\nNotice that we turned of the transform and report rules in this example. We\ncould leave the transform rules enabled if we wanted to see the AST after\ntransformation. If we leave the report active, we'll get an object returned\nthat contains the AST and the report.\n\n## Programmatic usage\n\nAll the same options are available programmatically.\n\n```js\nvar doctor = require('doctor');\nvar options = {\n  files: ['myfile1.js', 'myfile2.js'],\n  view: ['default', '~/my-view'],\n  grammar: '~/my-better-grammar.pegjs',\n  transform: ['default', '~/more-tranform-rules.js'],\n  report: {js:\n    ['default', '~/more-report-rules.js']\n  },\n  render: 'default',\n  unknown: false,\n  output: '~/documentation'\n};\ndoctor.examine(options, function (err, report) {\n  // done\n});\n```\n\n## API\n\nFor writing transform and report rules, you'll need to learn doctor's API. You\ncan see doctor's own documentation for that:\n\nhttp://jdeal.github.com/doctor/doc\n\n## Conventions\n\nThe default rules supplied by doctor (report/default) will document the\nfollowing conventions in your code. (In this section, _doctor_ may refer to\ndoctor and its default rules.)\n\n### CommonJS modules\n\nDoctor only documents the public API, via CommonJS exports.\n\n```js\nexports.foo = function () {};\n```\n\n```js\nmodule.exports = {foo: function () {}}\n```\n\n```js\nmodule.exports = function () {}\n```\n\nNote that doctor can find many variations of the above patterns. For example,\nit can generally see when you're setting variables and then exporting those\nvariables, even if you're setting the variables to other required modules. If\ndoctor can't figure out what you're exporting, there's a good chance humans also\ncan't figure it out.\n\n### AMD modules\n\nDoctor sees AMD-style exports as well.\n\n```js\ndefine(function () {\n  return {foo: function () {}};\n});\n```\n\nAgain, it can see some variations of\nthis, although it may not be quite as resilient as node-style exports.\n\n### Function parameters\n\nOf course, doctor documents parameters of exported functions.\n\n```js\nfunction foo(bar) {}\n```\n\n### Optional parameters\n\nDoctor can see where a parameter is given a default value.\n\n```js\nfunction foo(bar) {\n  bar = bar || 'baz';\n}\n```\n\n### Constructors\n\nDoctor will assume upper-case functions are constructors.\n\n```js\nfunction Foo() {}\n\nmodule.exports = Foo;\n```\n\n### Instances\n\nDoctor can see when an instance is exported.\n\n```js\nfunction Foo() {}\n\nFoo.prototype.bar = function () {};\n\nmodule.exports = new Foo();\n```\n\nGiven that export, doctor knows your module has exported a function named bar.\n\n### Following dependencies\n\nDoctor can follow require.\n\n```js\nvar bar = require('./bar');\n\nexports.bar = bar;\n```\n\nAnd it can follow AMD dependencies.\n\n```js\ndefine(['./bar'], function (bar) {\n  return {bar: bar};\n});\n```\n\nNote that doctor will only document what is passed to it. It will not document\ndependent modules, except when they are exported from a passed-in module.\n\nSo, if the above code is part of foo.js, and you call doctor like this:\n\n```bash\ndoctor lib/foo.js\n```\n\nbar.js will not be documented, even though doctor follows it.\n\n### Literal prototypes\n\n```js\nfunction Foo() {\n}\n\nFoo.prototype = {\n  bar: function () {\n  }\n}\n```\n\n## JSDoc tags\n\nWhere doctor cannot infer documentation from convention, JSDoc tags can be used\nto annotate the code.\n\nNote that you can use multi-line or single-line comment style.\n\n### @description\n\nAdd a description to a function, using markdown.\n\n```js\n/*\n@description Returns a greeting.\n*/\nfunction hello() {\n  return \"Hello!\";\n}\n```\n\nIf a comment appears with no tag, it is assumed to be a description.\n\n```js\n/*\nReturns a greeting.\n*/\nfunction hello() {\n  return \"Hello!\";\n}\n```\n\n### @param\n\nAdd a description and optional type to a function parameter.\n\n```js\n/*\n@param {string} name - Name of a person.\n*/\nfunction greeting(name) {\n  return \"Hello, \" + name + \".\";\n}\n```\n\nNote the optional dash (-) which can be used to visually separate the\ndescription.\n\nNote that doctor will match the parameters to the name of the function. So a\nfunction like this:\n\n```js\n/*\n@param {number} y - The y, of course.\n*/\nfunction foo(x, y, z) {\n  return x * y + z;\n}\n```\n\nwill add a description to the y parameter. This is different from JSDoc which\nmatches the parameters by position.\n\nIf a parameter is an object with certain properties, you can document the\nproperties like this:\n\n```js\n/*\n@param {object} car - The car.\n@param {number} car.speed - The speed of the car.\n*/\nfunction drive(car) {\n  console.log(\"The car is going \" + car.speed + \"mph.\");\n}\n```\n\nIf a parameter is a function with certain parameters, you can document the\nparameters like this:\n\n```js\n/*\n@param {function(err, message)} callback - Function to call when finished.\n*/\nfunction waitAndThen(callback) {\n  setTimeout(function () {\n    callback(null, \"hello\");\n  }, 1000);\n}\n```\n\nNote that doctor's default view doesn't do anything except parrot these\nparameters, but they are available in the report.\n\nOptional parameters can be documented with brackets, and default values can be\ndocumented with an assignment.\n\n```js\n/*\n@param {string} [name = \"you\"] - Name of a person.\n*/\nfunction greeting(name) {\n  name = name || \"you\";\n  return \"Hello, \" + name + \".\";\n}\n```\n\nAs noted above though, this is unnecessary, as doctor can see the convention for\noptional parameters.\n\n### @return, @returns\n\nDocument the return type of a function.\n\n```js\n/*\n@returns string\n*/\nfunction foo() {\n  return \"bar\";\n}\n```\n\n### @class\n\nAdd a description for the class.\n\n```js\n/*\n@class A useful widget.\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\n### @constructor\n\nAdd a description for the constructor.\n\n```js\n/*\n@constructor Makes a widget.\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\nThis is not really necessary since doctor sees upper-case functions as\nconstructors. In doctors default view, the constructor description just gets\nconcatenated to the description.\n\n### @example\n\nAdds example usage to a module or function.\n\n```js\n/*\n@example\nvar msg = greeting();\n*/\nfunction greeting() {\n  return \"Hello!\";\n}\n```\n\n### @extends\n\nSets the base class for a class.\n\n```js\n/*\n@extends Widget\n*/\nfunction UsefulWidget() {\n  \n}\n```\n\n(Yes, doctor should be support a convention for this.)\n\n### @private, @public\n\nDoctor's default rules assume that everything exported is public and everything\nelse is private.\n\nYou can explicitly set something to private to hide it in\ndoctor's default rules.\n\n```js\n/*\n@private\n*/\nmodule.exports._foo = function () {\n  return \"Don't use me. I'm not documented!\";\n}\n```\n\nYou can explicitly set something to public to force doctor to add it to the\nreport. For example, in some cases, you may export something (say, via a\nreturn value of a function) that doctor doesn't see as public. If you mark a\nconstructor as public, doctor will automatically add all methods of that class\nto the report as well.\n\n```js\n/*\nSecret constructor.\n\n@class Secret maker.\n\n@public\n*/\nfunction Secret() {\n}\n```\n\n### @signature\n\nThis allows documenting alternate signatures of a single function. For example,\na setter and getter can sometimes be the same function. The @signature parameter\nset the description for these signatures and allows overriding parameter \ndescriptions.\n\n```js\n/*\n@param name - Attribute name.\n*/\nfunction attr(name, value) {\n/*\n@signature Get attribute value.\n@param value - Attribute value.\n*/\n  if (typeof value === 'undefined') {\n\n  }\n/*\n@signature Set attribute value.\n*/\n}\n```\n\n### @copy\n\nThis allows copying the tags from another function in the case that one\nfunction shares parameters or descriptions with another function.\n\n```js\n/*\nCreate a TPS report.\n@param name - Author of the report.\n@param verbose - Add \n*/\nfunction createTpsReport(name, verbose) {\n  return {\n    name: name,\n    summary: \"I didn't get any cake.\"\n  }\n  if (verbose) {\n    console.log(\"wasting time...\");\n  }\n}\n\n/*\n@copy createTpsReprot\n*/\nfunction createVerboseTpsReport(name) {\n  createTpsReport(name, true);\n}\n```\n\n### @abstract\n\nReally? What, are you a Java programmer?\n\nFine, this marks a class as abstract.\n\n## Writing custom rules\n\nDoctor's default rules are useful for normal documentation tasks, but you can do\nall kinds of neat things by writing your own rules.\n\nA rules module should export an array of rules or an object with a \"rules\"\nproperty. If multiple rules match the same AST node type, then they will fire\nin the order in which they declare.\n\n### Transform rules\n\nTransform rules follow this pattern:\n\n```js\n{\n  type: 'define-function',\n  match: function (node) {\n    var name = node.nodes[0].value;\n    return name === 'foo';\n  },\n  transform: function (node, report) {\n    node.remove();\n  }\n}\n```\n\n__type__\n\nThis property should be a string specifying the AST node type or an array of\nnode types. Note that you can use pseudo-end node types, for which rules will\nfire after all descendent node rules have fired. For example, define-function\nhas a corresponding end-define-function which will fire after the entire body\nof the function has been processed.\n\n__match__ (optional)\n\nThis property is an optional function that can further filter the node.\n\n__transform__\n\nThis property is a function that is called to transform the node.\n\n### Report rules\n\nReport rules follow this pattern:\n\n```js\n{\n  type: 'define-function',\n  match: function (node) {\n    var name = node.nodes[0].value;\n    return name === 'foo';\n  },\n  report: function (node, report) {\n    var name = node.nodes[0].value;\n    return {\n      key: 'define-function:' + name,\n      name: name\n    }\n  }\n}\n```\n\n__type__\n\nThis property should be a string specifying the AST node type or an array of\nnode types. Note that you can use pseudo-end node types, for which rules will\nfire after all descendent node rules have fired. For example, define-function\nhas a corresponding end-define-function which will fire after the entire body\nof the function has been processed.\n\n__match__ (optional)\n\nThis property is an optional function that can further filter the node.\n\n__report__\n\nThis property is a function that manipulates the report, either via the report\nparameter or by returning a report item or an array of report items.\n\n## AST node types\n\nIf you write your own rules, you'll need to know the following AST node types.\n\nAs noted above, each AST node type has a corresponding end type. So\ndefine-function has a matching end-define-function.\n\n### files\n\nA group of all files. Rules for this node type (and the corresponding end-files)\nwill fire only once.\n\n### file\n\nEach file.\n\n### undefined\n\nUndefined node. For example: if an else clause of an if statement is\nundefined, the else clause will be an undefined node.\n\n### name\n\nAn identifier. For example: a function name, a variable name.\n\n### number\n\nA number. For example: 3, 5.6.\n\n### string\n\nA string. For example: \"hello\".\n\n### null\n\nA null literal.\n\n### boolean\n\nA boolean literal (true or false).\n\n### regex\n\nA literal regular expression.\n\n### regex-body\n\nThe body (between the slashes) of a regular expression.\n\n### regex-flags\n\nThe flags (after the second slash) of a regular expression.\n\n### this\n\nThe \"this\" keyword.\n\n### object\n\nA literal object.\n\n### property\n\nA key and value set of a literal object.\n\n### get\n\nGetter.\n\n### set\n\nSetter.\n\n### new\n\nUsing new to instantiate an object with a constructor.\n\n### dot\n\nUsing dot to access a property or method. For example: foo.bar, foo.baz().\n\n### call\n\nA function call.\n\n### subscript\n\nUsing brackets to access a property or index. For example: foo[0], foo[\"bar\"].\n\n### expression\n\nA parenthetical expression. For example: (3 + 5), (a || b).\n\n### postfix\n\nA postfix expression. For example: x--, i++.\n\n### operator\n\nThe operator used in an expression.\n\n### unary\n\nA unary prefix expression. For example: --x, ++i;\n\n### binary\n\nAn binary expression. For example: 3 + 5, a || b.\n\n### conditional\n\nA conditional expression.\n\n### assign\n\nAssignment of a value to a variable.\n\n### vars\n\nA group of variable declarations.\n\n### var\n\nA single variable declaration.\n\n### empty\n\nAn empty statment, which basically means a semicolon by itself.\n\n### if\n\nAn if statement.\n\n### do-while\n\nA do-while statement.\n\n### while\n\nA while statement.\n\n### for\n\nA for loop.\n\n### for-in\n\nA for-in loop.\n\n### continue\n\nA continue statement.\n\n### break\n\nA break statement.\n\n### return\n\nA return statement.\n\n### with\n\nA with statement.\n\n### switch\n\nA switch statement.\n\n### case\n\nA case statement of a switch statement.\n\n### default\n\nA default statement of a switch statement.\n\n### nodes\n\nA group of AST nodes, which is part of another node. For example, the body of a\nfunction is a node of type \"nodes\" containing all the nodes of the body.\n\n### labeled-statement\n\nA labeled statement.\n\n### throw\n\nA throw.\n\n### try\n\nA try.\n\n### catch\n\nA catch clause of a try.\n\n### finally\n\nA finally clause of a try.\n\n### debug\n\nA debugger statement.\n\n### define-function\n\nA function definition.\n\n### function\n\nA function expression.\n\n### parameters\n\nThe parameters of a function.\n\n## FAQ\n\n### Why did you do this? Don't you know [insert here] already exists.\n\nYeah, but [insert here] works off of comment tags and not off of coding\nconventions. And [insert here] doesn't make it easy to add new conventions. And\n[insert here] isn't a pure node module. And doctor aims to be a general purpose\ncode analysis tool.\n\n### Seriously, why did you do this?\n\nSome kind of OCD thing.\n\n### Why isn't this split into two projects, one for the analysis tool and another for code documentation?\n\nMaybe it should be. It grew up that way, and I haven't spent any thought or\neffort on splitting it.\n\n### Why is the code so ugly? What's with all these weird wrapping closures around fs and path?\n\nThat is thanks to synchronous require. I love node, but I hate synchronous\nrequire. (Yes, I understand why it's synchronous.) Because I wanted doctor to\nwork asynchronously or synchronously, I had to make asynchronous signatures for\nthe synchronous functions and then swap them out as needed.\n\nThe rest of the ugliness is my fault.\n\n### How do I contribute?\n\nThe usual: fork, add a (preferably discrete) fix/change with the necessary\ntests, and do a pull request. I can't promise to respond immediately or even in\na reasonable timeframe, but I'll do my best to eventually get to it.\n\n### Have these questions actually been frequently asked?\n\nNo, just being proactive.","readmeFilename":"README.md","bugs":{"url":"https://github.com/jdeal/doctor/issues"},"_id":"doctor@0.3.0","dist":{"shasum":"7626714195fba89b2b871a78fd2ef58b8158eca3","tarball":"https://registry.npmjs.org/doctor/-/doctor-0.3.0.tgz","integrity":"sha512-8I/XIHta9LQ+whx35dQc5yTutg61aPepvbmZEeCBWAHwlsWsQV8+ClV7Wylra2hnMf2II4TPIxguVmy6HABuyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB/zOVEMQ0tiDjL+wmEYiSPGAPtDVfbnll8ook137Yb0AiARSDOwmtGG5Cy/8F4S1ejDgBa/qd+82wTNcPEf0qIp4w=="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"jdeal","email":"justin.deal@gmail.com"},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}]}},"maintainers":[{"name":"jdeal","email":"justin.deal@gmail.com"}],"time":{"modified":"2022-06-15T20:24:20.010Z","created":"2011-11-01T21:34:33.681Z","0.0.0":"2011-11-01T21:34:34.499Z","0.0.1":"2011-11-26T23:26:08.584Z","0.0.2":"2011-11-30T00:27:50.781Z","0.1.0":"2012-01-04T03:01:51.534Z","0.1.1":"2012-01-06T04:11:49.997Z","0.1.2":"2012-01-06T17:20:54.621Z","0.1.3":"2012-01-10T03:17:15.103Z","0.1.4":"2012-01-10T05:15:35.146Z","0.1.5":"2012-01-10T16:48:05.205Z","0.1.6":"2012-01-24T19:04:38.297Z","0.1.7":"2012-01-24T19:36:47.485Z","0.1.8":"2012-01-24T20:18:37.461Z","0.1.9":"2012-01-27T17:19:28.760Z","0.1.10":"2012-01-31T18:12:31.658Z","0.1.11":"2012-02-01T20:54:52.177Z","0.1.12":"2012-02-02T20:24:49.930Z","0.1.13":"2012-02-02T22:57:20.940Z","0.1.14":"2012-02-03T05:07:53.820Z","0.1.15":"2012-02-07T15:27:54.406Z","0.1.16":"2012-02-09T03:49:19.005Z","0.1.17":"2012-02-14T17:06:14.067Z","0.1.18":"2012-02-14T20:20:39.068Z","0.1.19":"2012-02-15T22:35:50.234Z","0.1.20":"2012-02-17T04:40:38.731Z","0.1.21":"2012-04-07T03:19:28.242Z","0.1.22":"2012-04-11T21:36:58.339Z","0.1.23":"2012-04-17T14:43:42.685Z","0.1.24":"2012-04-17T19:13:30.457Z","0.1.25":"2012-04-17T19:25:43.285Z","0.1.26":"2012-04-19T21:41:05.698Z","0.1.27":"2012-04-20T15:20:51.241Z","0.1.28":"2012-04-20T21:29:51.949Z","0.1.29":"2012-07-30T03:21:47.425Z","0.1.30":"2012-09-12T19:46:24.851Z","0.1.32":"2012-10-01T02:28:31.245Z","0.1.33":"2012-10-01T14:28:31.576Z","0.2.0":"2012-12-15T03:53:56.113Z","0.2.1":"2012-12-15T04:33:22.574Z","0.2.2":"2012-12-15T04:41:46.327Z","0.2.3":"2013-01-02T07:03:54.303Z","0.3.0":"2013-10-22T02:55:27.594Z"},"author":{"name":"Justin Deal"},"repository":{"type":"git","url":"git://github.com/jdeal/doctor.git"},"users":{"fgribreau":true,"luk":true}}