File tree Expand file tree Collapse file tree 6 files changed +152
-913
lines changed Expand file tree Collapse file tree 6 files changed +152
-913
lines changed Original file line number Diff line number Diff line change 3
3
[](https://github.com/jsdoc2md/jsdoc-api/network/dependents?dependent_type=REPOSITORY)
4
4
[](https://github.com/jsdoc2md/jsdoc-api/network/dependents?dependent_type=PACKAGE)
5
5
[](https://github.com/jsdoc2md/jsdoc-api/actions/workflows/node.js.yml)
6
- [](https://coveralls.io/github/jsdoc2md/jsdoc-api)
7
6
[](https://github.com/feross/standard)
8
7
9
8
# jsdoc-api
@@ -51,6 +50,6 @@ A programmatic interface for [jsdoc3](https://github.com/jsdoc3/jsdoc) with a fe
51
50
52
51
* * *
53
52
54
- © 2015-23 [Lloyd Brookes](https://github.com/75lb) \<75pound @gmail.com\>.
53
+ © 2015-24 [Lloyd Brookes](https://github.com/75lb) \<75pound @gmail.com\>.
55
54
56
55
Tested by [test-runner](https://github.com/test-runner-js/test-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).
Original file line number Diff line number Diff line change @@ -116,15 +116,13 @@ class JsdocCommand {
116
116
* @returns {Promise }
117
117
* @fulfil {object[]}
118
118
*/
119
- readCache ( ) {
119
+ async readCache ( ) {
120
120
if ( this . cache ) {
121
- const fs = require ( 'fs-then-native' )
121
+ const fs = require ( 'fs' ) . promises
122
122
const promises = this . inputFileSet . files . map ( file => fs . readFile ( file , 'utf8' ) )
123
- return Promise . all ( promises )
124
- . then ( contents => {
125
- this . cacheKey = contents . concat ( this . inputFileSet . files )
126
- return this . cache . read ( this . cacheKey )
127
- } )
123
+ const contents = await Promise . all ( promises )
124
+ this . cacheKey = contents . concat ( this . inputFileSet . files )
125
+ return this . cache . read ( this . cacheKey )
128
126
} else {
129
127
return Promise . reject ( )
130
128
}
Original file line number Diff line number Diff line change 1
1
const fs = require ( 'fs' )
2
- const getTempPath = require ( 'temp-path' )
2
+ const os = require ( 'os' )
3
+ const crypto = require ( 'crypto' )
4
+ const path = require ( 'path' )
3
5
4
6
class TempFile {
5
7
constructor ( source ) {
6
- this . path = getTempPath ( ) + '.js'
8
+ const tempDir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'jsdoc-api-' ) )
9
+ this . path = path . join ( tempDir , crypto . randomBytes ( 6 ) . toString ( 'hex' ) + '.js' )
7
10
fs . writeFileSync ( this . path , source )
8
11
}
9
12
delete ( ) {
You can’t perform that action at this time.
0 commit comments