Skip to content

Commit d1311fc

Browse files
committed
upgrade deps.. factor out temp-path, fs-then-native and coveralls
1 parent 3f5457c commit d1311fc

File tree

6 files changed

+152
-913
lines changed

6 files changed

+152
-913
lines changed

jsdoc2md/README.hbs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![Gihub repo dependents](https://badgen.net/github/dependents-repo/jsdoc2md/jsdoc-api)](https://github.com/jsdoc2md/jsdoc-api/network/dependents?dependent_type=REPOSITORY)
44
[![Gihub package dependents](https://badgen.net/github/dependents-pkg/jsdoc2md/jsdoc-api)](https://github.com/jsdoc2md/jsdoc-api/network/dependents?dependent_type=PACKAGE)
55
[![Node.js CI](https://github.com/jsdoc2md/jsdoc-api/actions/workflows/node.js.yml/badge.svg)](https://github.com/jsdoc2md/jsdoc-api/actions/workflows/node.js.yml)
6-
[![Coverage Status](https://coveralls.io/repos/github/jsdoc2md/jsdoc-api/badge.svg)](https://coveralls.io/github/jsdoc2md/jsdoc-api)
76
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
87

98
# jsdoc-api
@@ -51,6 +50,6 @@ A programmatic interface for [jsdoc3](https://github.com/jsdoc3/jsdoc) with a fe
5150

5251
* * *
5352

54-
&copy; 2015-23 [Lloyd Brookes](https://github.com/75lb) \<75pound@gmail.com\>.
53+
&copy; 2015-24 [Lloyd Brookes](https://github.com/75lb) \<75pound@gmail.com\>.
5554

5655
Tested by [test-runner](https://github.com/test-runner-js/test-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

lib/jsdoc-command.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,13 @@ class JsdocCommand {
116116
* @returns {Promise}
117117
* @fulfil {object[]}
118118
*/
119-
readCache () {
119+
async readCache () {
120120
if (this.cache) {
121-
const fs = require('fs-then-native')
121+
const fs = require('fs').promises
122122
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)
128126
} else {
129127
return Promise.reject()
130128
}

lib/temp-file.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
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')
35

46
class TempFile {
57
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')
710
fs.writeFileSync(this.path, source)
811
}
912
delete () {

0 commit comments

Comments
 (0)