You could, but this is very ill-advised to do so.
Bitcoin consensus rules being implementation-defined rather than specification-defined re-implementation are unfortunately insecure.
Thanks to libbitcoinconsensus
, it has been made safer to build transactions with external tool. There might be a nodejs implementing transaction building logic out there, but you really should not validate blocks with a nodejs (or any language for that matter) re-implementation of Bitcoin.
Regarding your desire to learn more about the inner working of a node you can learn from external Bitcoin tool in your favorite language but at the end of the day if you want to learn how the protocol is really defined, you'll have to dig into the original implementation code.