Comparing version 9.1.1 to 9.1.2
'use strict'; | ||
var node_net = require('node:net'); | ||
async function bootstrap(t) { | ||
const {default: getPorts, portNumbers} = await import('get-port'); | ||
const port = await getPorts({ | ||
port: portNumbers(3000, 3500) | ||
}); | ||
const port = await getPort(); | ||
t.context = { | ||
@@ -13,2 +12,17 @@ port | ||
function getPort() { | ||
return new Promise((resolve, reject) => { | ||
const server = node_net.createServer(); | ||
server.unref(); | ||
server.on('error', reject); | ||
server.listen(() => { | ||
const { port } = server.address(); | ||
server.close(() => { | ||
resolve(port); | ||
}); | ||
}); | ||
}); | ||
} | ||
exports.bootstrap = bootstrap; | ||
exports.getPort = getPort; |
@@ -1,3 +0,1 @@ | ||
/* eslint-disable no-console */ | ||
'use strict'; | ||
@@ -4,0 +2,0 @@ const { Client, Message } = require('node-osc'); |
@@ -1,3 +0,1 @@ | ||
/* eslint-disable no-console */ | ||
'use strict'; | ||
@@ -4,0 +2,0 @@ var { Server } = require('node-osc'); |
{ | ||
"name": "node-osc", | ||
"description": "pyOSC inspired library for sending and receiving OSC messages", | ||
"version": "9.1.1", | ||
"version": "9.1.2", | ||
"exports": { | ||
@@ -29,4 +29,4 @@ "require": "./dist/lib/index.js", | ||
"test": "npm run lint && npm run build && npm run test:esm && npm run test:cjs", | ||
"test:esm": "tap -j1 test/test-*.mjs", | ||
"test:cjs": "tap -j1 dist/test/test-*.js" | ||
"test:esm": "tap test/test-*.mjs", | ||
"test:cjs": "tap dist/test/test-*.js" | ||
}, | ||
@@ -50,7 +50,8 @@ "contributors": [ | ||
"devDependencies": { | ||
"eslint": "^8.36.0", | ||
"get-port": "^6.1.2", | ||
"rollup": "^4.9.5", | ||
"tap": "^18.4.2" | ||
"@eslint/js": "^9.4.0", | ||
"eslint": "^9.4.0", | ||
"globals": "^15.3.0", | ||
"rollup": "^4.18.0", | ||
"tap": "^19.0.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57901
40
1576
5