This is a bitcoin mnemonic generator and WIF converter. It is based on the BIP-0039. It generates 12 mnemonic word list, which can be used to generate a seed phrase, and it convert the phrase to private key and the private key is converted to WIF.
npm i bitcoin-wif
const BitcoinWIF = require("bitcoin-wif");
let network = "testnet";
const btcWIF = new BitcoinWIF(network);
// network can be "mainnet", "testnet" and "regtest"
let mnemonic = btcWIF.mnemonic();
console.log(mnemonic);
// cactus juice camera muscle recall turkey birth fever dust cactus average impact
let words =
"army van defense carry jealous true garbage claim echo media make crunch";
let seed = btcWIF.seed(words);
console.log(seed);
// 5b56c417303faa3fcba7e57400e120a0ca83ec5a4fc9ffba757fbe63fbd77a89a1a3be4c67196f57c39a88b76373733891bfaba16ed27a813ceed498804c0570
let seedResult =
"5b56c417303faa3fcba7e57400e120a0ca83ec5a4fc9ffba757fbe63fbd77a89a1a3be4c67196f57c39a88b76373733891bfaba16ed27a813ceed498804c0570";
let privateKey = btcWIF.privateKey(seedResult);
console.log(privateKey);
// b2a0d576b828b537688b561f2cfa8dac3602d54c62bde619ad5331e6c235ee26
let privateKeyResult =
"619c335025c7f4012e556c2a58b2506e30b8511b53ade95ea316fd8c3286feb9";
let wif = btcWIF.wif(privateKeyResult);
console.log(wif);
// 92KuV1Mtf9jTttTrw1yawobsa9uCZGbfpambH8H1Y7KfdDxxc4d