You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`includeParents`| Whether the highest level package directory should be scanned or only the lowest level base directory. |`false`|
59
+
|`knockknock`| Any options to be passed to [KnockKnock](https://github.com/Skelp/node-knockknock). `limit` will always be overridden to `1`. |`null`|
60
+
|`path`| The file/directory path from where to derive the base directory to be scanned. Path to module that called PacScan will be used when `null`. |`null`|
61
+
62
+
If you only want to list the packages available to your module/package:
63
+
64
+
```javascript
65
+
constpacscan=require('pacscan')
66
+
67
+
module.exports=function() {
68
+
pacscan()
69
+
.then((packages) => {
70
+
console.log(`${packages.length} packages found`)
71
+
72
+
// ...
73
+
})
74
+
}
75
+
```
76
+
77
+
However, if you're calling PacScan from within a library that is most likely being included in another package as a
78
+
dependency. In these cases, you might want to know all of the packages available in the base package (i.e. the highest
79
+
level package that is not a dependency itself). All that you need to do for this is to enable the `includeParents`
80
+
option.
41
81
42
82
### `pacscan.sync([options])`
43
83
44
-
TODO: Document
84
+
A synchronous alternative to `pacscan([options])`.
85
+
86
+
```javascript
87
+
constpacscan=require('pacscan')
88
+
89
+
module.exports=function() {
90
+
constpackages=pacscan.sync()
91
+
92
+
console.log(`${packages.length} packages found`)
93
+
94
+
// ...
95
+
}
96
+
```
45
97
46
98
### `pacscan.version`
47
99
@@ -51,7 +103,7 @@ The current version of PacScan.
0 commit comments