Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

Commit 81ef83c

Browse files
committed
add simple cli
1 parent 2c5051a commit 81ef83c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

bin/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env node
2+
const fs = require('fs');
3+
const parseComments = require('./../dist/openapi-comment-parser');
4+
5+
const outputPath = process.argv[2];
6+
7+
const spec = parseComments({ cwd: process.cwd() });
8+
9+
fs.writeFileSync(outputPath, JSON.stringify(spec));

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"engines": {
55
"node": ">=10.0.0"
66
},
7+
"bin": {
8+
"openapi-comment-parser": "./bin/index.js"
9+
},
710
"license": "MIT",
811
"description": "JSDoc Comments for the OpenApi Specification",
912
"homepage": "https://github.com/bee-travels/openapi-comment-parser",
@@ -23,6 +26,7 @@
2326
"express"
2427
],
2528
"files": [
29+
"/bin",
2630
"/dist"
2731
],
2832
"main": "dist/openapi-comment-parser.js",

0 commit comments

Comments
 (0)