npm i eosjs-ecc
node
let {PrivateKey, PublicKey, Signature, Aes, key_utils, config} = require('eosjs-ecc')
// Create a new random private key
let privateWif
PrivateKey.randomKey().then(privateKey => privateWif = privateKey.toWif())
// Convert to a public key
pubkey = PrivateKey.fromWif(privateWif).toPublic().toString()
tested with npm version 5.6.0 and node version 9.9.0. may work with others, but no guarantees.