Skip to content

Commit 1224289

Browse files
committed
Use Node util.promisify
1 parent 3d71b87 commit 1224289

18 files changed

+31
-39
lines changed

dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/docco/lib/openssl.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ <h1>openssl.js</h1>
7272

7373
<span class="hljs-keyword">const</span> versionRegEx = <span class="hljs-keyword">new</span> <span class="hljs-title class_">RegExp</span>(<span class="hljs-string">&#x27;^(OpenSSL|LibreSSL) (((\\d+).(\\d+)).(\\d+))([a-z]+)?&#x27;</span>)
7474

75-
<span class="hljs-keyword">if</span> (<span class="hljs-string">&quot;CI&quot;</span> <span class="hljs-keyword">in</span> process.<span class="hljs-property">env</span> &amp;&amp; process.<span class="hljs-property">env</span>.<span class="hljs-property">CI</span> === <span class="hljs-string">&#x27;true&#x27;</span>) {
75+
<span class="hljs-keyword">if</span> (<span class="hljs-string">&quot;DEBUG&quot;</span> <span class="hljs-keyword">in</span> process.<span class="hljs-property">env</span> &amp;&amp; process.<span class="hljs-property">env</span>.<span class="hljs-property">DEBUG</span> === <span class="hljs-string">&#x27;true&#x27;</span>) {
7676
<span class="hljs-keyword">if</span> (<span class="hljs-string">&quot;LIBRARY&quot;</span> <span class="hljs-keyword">in</span> process.<span class="hljs-property">env</span> &amp;&amp; <span class="hljs-string">&quot;VERSION&quot;</span> <span class="hljs-keyword">in</span> process.<span class="hljs-property">env</span> &amp;&amp; process.<span class="hljs-property">env</span>.<span class="hljs-property">LIBRARY</span> != <span class="hljs-string">&quot;&quot;</span> &amp;&amp; process.<span class="hljs-property">env</span>.<span class="hljs-property">VERSION</span> != <span class="hljs-string">&quot;&quot;</span>) {
7777
<span class="hljs-keyword">const</span> filePathOpenSSL=<span class="hljs-string">`./openssl/<span class="hljs-subst">${process.env.LIBRARY}</span>_v<span class="hljs-subst">${process.env.VERSION}</span>/bin/openssl`</span>
7878
<span class="hljs-keyword">if</span> (fs.<span class="hljs-title function_">existsSync</span>(filePathOpenSSL)) {
@@ -338,12 +338,11 @@ <h1>openssl.js</h1>
338338
* <span class="hljs-doctag">@param</span> {<span class="hljs-type">Function</span>} callback Callback function with an error object
339339
*/</span>
340340
<span class="hljs-keyword">function</span> <span class="hljs-title function_">testOpenSSLPath</span>(<span class="hljs-params">pathBin, callback</span>) {
341-
<span class="hljs-title function_">which</span>(pathBin, <span class="hljs-keyword">function</span> (<span class="hljs-params">error</span>) {
342-
<span class="hljs-keyword">if</span> (error) {
343-
<span class="hljs-keyword">return</span> <span class="hljs-title function_">callback</span>(<span class="hljs-keyword">new</span> <span class="hljs-title class_">Error</span>(<span class="hljs-string">&#x27;Could not find openssl on your system on this path: &#x27;</span> + pathBin))
344-
}
345-
<span class="hljs-title function_">callback</span>()
346-
})
341+
<span class="hljs-keyword">const</span> resolved = which.<span class="hljs-title function_">sync</span>(pathBin, { <span class="hljs-attr">nothrow</span>: <span class="hljs-literal">true</span> });
342+
<span class="hljs-keyword">if</span> (!resolved) {
343+
<span class="hljs-keyword">return</span> <span class="hljs-title function_">callback</span>(<span class="hljs-keyword">new</span> <span class="hljs-title class_">Error</span>(<span class="hljs-string">&#x27;Could not find openssl on your system on this path: &#x27;</span> + pathBin))
344+
}
345+
<span class="hljs-title function_">callback</span>()
347346
}
348347

349348
<span class="hljs-comment">/* Once PEM is imported, the openSslVersion is set with this function. */</span>
@@ -361,7 +360,7 @@ <h1>openssl.js</h1>
361360
<span class="hljs-title function_">set</span>(<span class="hljs-string">&#x27;VendorVersionMinor&#x27;</span>, version[<span class="hljs-number">5</span>])
362361
<span class="hljs-title function_">set</span>(<span class="hljs-string">&#x27;VendorVersionPatch&#x27;</span>, version[<span class="hljs-number">6</span>])
363362
<span class="hljs-title function_">set</span>(<span class="hljs-string">&#x27;VendorVersionBuildChar&#x27;</span>, <span class="hljs-keyword">typeof</span> version[<span class="hljs-number">7</span>] === <span class="hljs-string">&#x27;undefined&#x27;</span> ? <span class="hljs-string">&#x27;&#x27;</span> : version[<span class="hljs-number">7</span>])
364-
};
363+
}
365364

366365
<span class="hljs-title function_">setVersion</span>();
367366

docs/docco/lib/pem.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h1>pem.js</h1>
6666
* <span class="hljs-doctag">@module</span> <span class="hljs-variable">pem</span>
6767
*/</span>
6868
<span class="hljs-keyword">const</span> {debug} = <span class="hljs-built_in">require</span>(<span class="hljs-string">&#x27;./debug.js&#x27;</span>)
69-
<span class="hljs-keyword">const</span> {promisify} = <span class="hljs-built_in">require</span>(<span class="hljs-string">&#x27;es6-promisify&#x27;</span>)
69+
<span class="hljs-keyword">const</span> {promisify} = <span class="hljs-built_in">require</span>(<span class="hljs-string">&#x27;node:util&#x27;</span>)
7070
<span class="hljs-keyword">var</span> net = <span class="hljs-built_in">require</span>(<span class="hljs-string">&#x27;net&#x27;</span>)
7171
<span class="hljs-keyword">var</span> helper = <span class="hljs-built_in">require</span>(<span class="hljs-string">&#x27;./helper.js&#x27;</span>)
7272
<span class="hljs-keyword">var</span> openssl = <span class="hljs-built_in">require</span>(<span class="hljs-string">&#x27;./openssl.js&#x27;</span>)

docs/jsdoc/convert.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ <h1 class="page-title">convert.js</h1>
332332
<br class="clear">
333333

334334
<footer>
335-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Fri Jun 02 2023 11:32:07 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
335+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Sun Oct 26 2025 18:03:59 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
336336
</footer>
337337

338338
<script>prettyPrint();</script>

docs/jsdoc/global.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ <h5>Parameters:</h5>
262262
<br class="clear">
263263

264264
<footer>
265-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Fri Jun 02 2023 11:32:07 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
265+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Sun Oct 26 2025 18:03:59 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
266266
</footer>
267267

268268
<script>prettyPrint();</script>

docs/jsdoc/helper.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ <h1 class="page-title">helper.js</h1>
189189
<br class="clear">
190190

191191
<footer>
192-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Fri Jun 02 2023 11:32:07 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
192+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Sun Oct 26 2025 18:03:59 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
193193
</footer>
194194

195195
<script>prettyPrint();</script>

docs/jsdoc/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h2>License</h2>
376376
<br class="clear">
377377

378378
<footer>
379-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Fri Jun 02 2023 11:32:07 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
379+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Sun Oct 26 2025 18:03:59 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
380380
</footer>
381381

382382
<script>prettyPrint();</script>

docs/jsdoc/module-convert.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1606,7 +1606,7 @@ <h5>Parameters:</h5>
16061606
<br class="clear">
16071607

16081608
<footer>
1609-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Fri Jun 02 2023 11:32:07 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1609+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Sun Oct 26 2025 18:03:59 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
16101610
</footer>
16111611

16121612
<script>prettyPrint();</script>

docs/jsdoc/module-helper.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ <h5>Parameters:</h5>
11151115
<br class="clear">
11161116

11171117
<footer>
1118-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Fri Jun 02 2023 11:32:07 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1118+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Sun Oct 26 2025 18:03:59 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
11191119
</footer>
11201120

11211121
<script>prettyPrint();</script>

0 commit comments

Comments
 (0)