bun
bun copied to clipboard
os.networkInterfaces and os.cpus return empty objects
What version of Bun is running?
0.3.0
What platform is your computer?
Darwin 20.6.0 Darwin Kernel Version 20.6.0: Tue Jun 21 20:50:28 PDT 2022; root:xnu-7195.141.32~1/RELEASE_X86_64 x86_64 i386
What steps can reproduce the bug?
import { cpus, networkInterfaces } from 'os';
console.log({
cpus: cpus(),
networkInterfaces: networkInterfaces(),
});
How often does it reproduce? Is there a required condition?
100% of the time, tested on both macos and linux.
What is the expected behavior?
{
cpus: [
{
model: 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz',
speed: 2500,
times: [Object]
},
{
model: 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz',
speed: 2500,
times: [Object]
},
{
model: 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz',
speed: 2500,
times: [Object]
},
{
model: 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz',
speed: 2500,
times: [Object]
},
{
model: 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz',
speed: 2500,
times: [Object]
},
{
model: 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz',
speed: 2500,
times: [Object]
},
{
model: 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz',
speed: 2500,
times: [Object]
},
{
model: 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz',
speed: 2500,
times: [Object]
}
],
networkInterfaces: {
lo0: [ [Object], [Object], [Object] ],
en0: [ [Object], [Object] ],
awdl0: [ [Object] ],
llw0: [ [Object] ],
utun0: [ [Object] ],
utun1: [ [Object] ],
utun2: [ [Object] ],
utun3: [ [Object] ],
utun4: [ [Object] ],
utun5: [ [Object] ]
}
}
What do you see instead?
{ cpus: [], networkInterfaces: { } }
Additional information
No response
These functions aren't implemented yet. We removed an earlier implementation which was too buggy
No worries, didn't see an issue or anything about this in the roadmap so figured I'd open an issue to track it.
os.cpus
is implemented but only for Linux at the moment