With node.js module syntax you can load a module and use it all in one expression:
const numCPUs = require('os').cpus().length;
Is there any equivalent for ES6 modules?
import os from 'os';
const numCPUs = os.cpus().length;
is the closest I can get; this is two full statements, and leaves me with an unwanted binding for os
.