Skip to content

Commit bbc8643

Browse files
committed
docs: add information about API to README.md
1 parent fb68d3a commit bbc8643

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,22 @@ npm exec vca -- --dir .
4646
* `-o` or `--out` : output directory. JSON file will output here.
4747
* `-p` or `--port` : select a port number for the local server.
4848

49-
## License
49+
## API
5050

51-
MIT License.
51+
vue-component-analyzer is also available as an API from v0.6.0.
52+
53+
This API is intended to be used for testing.
54+
55+
```javascript
56+
import {getImportDeclarationTree} from '@tkskto/vue-component-analyzer';
57+
58+
const jsonOfTree = getImportDeclarationTree('entryFile.vue');
59+
```
60+
61+
See [index.d.ts](./types/index.d.ts) for details of types.
5262

63+
(`lastModifiedTime` can be noise. If you don't need it remove explicitly.)
5364

65+
## License
66+
67+
MIT License.

types/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* name: filename
3+
* props: props defined in the component
4+
* size: filesize
5+
* lastModifiedTime: date modified the file
6+
* children: information array this file is importing
7+
*/
18
export interface FileReport {
29
name: string,
310
props: string,

0 commit comments

Comments
 (0)