Using Javascript, I want to generate a segwit private key (zprv) similarly to how I am generating my legacy base58 extended private key. How? let bip32 = require('bip32');
let bip39 = require('bip39');
let { bech32, bech32m } = require('bech32')

const seed = bip39.mnemonicToSeedSync('rural catch say tooth tell soul road pilot fee board goose wedding');
// ^randomly generated for this question

const node = bip32.fromSeed(seed, bitcoin.networks.testnet);

//legacy account extended private key
console.log(&quot;LEGACY: &quot; + node.derivePath(&quot;m/44'/0/0&quot;).toBase58()); 
//tprv8giQNMeV5drQbXzAxSaVDj5Q1rAuTDZdGWoSx5oaLfuk9rupqVZXoziLgJSpkuauCToZw7BepygJjJaDBWKx5xQLimyg4KFtKnU2E7b99YH

//segwit account extended private key
//how do I take the same inputs, and get a segwit extended private key / zprv

This is how I'm getting my xprv, I'd like to also test out getting a zprv but I'm having trouble finding the documentation for this. I'm assuming it's going to be something using bech32.
Key derivation for P2WPKH using the zpub/zprv version bytes is defined in BIP 84. So you can use bip84 library.
let bip84 = require('bip84');

const root = new bip84.fromSeed('rural catch say tooth tell soul road pilot fee board goose wedding')
const child0 = root.deriveAccount(0) // m/84'/0'/0'
console.log(child0)
// zprvAce8anvk7mGXLFgryEKx2b8tETAKuJRFXM1SRN4wuZDw2cwzxYuJ9PJdecA9MJAuAuchhh3cfLfN3SSL8agTL3tJARw6TmgvAKVgcfVcANm