git ssb

1+

Rômulo Alves / dat-react-native



Tree: 80f8e8f709dfb501b449490162abcfe7ddf93c57

Files: 80f8e8f709dfb501b449490162abcfe7ddf93c57 / nodejs-assets / nodejs-project / utils.js

373 bytesRaw
1const freeport = require('freeport');
2
3/**
4 * @function findFreePort
5 * @description Returns a free port to start a server
6 * @return {Promise<Number>} A free port
7 */
8module.exports.findFreePort = () =>
9 new Promise((resolve, reject) => {
10 return freeport((err, port) => {
11 if (err) {
12 return reject(err);
13 }
14
15 return resolve(port);
16 });
17 });

Built with git-ssb-web