I've found this old question and thought updating with a recent open source library I found: https://github.com/faisalman/ua-parser-js
According to the docs, the method getCPU() returns { architecture: '' }, with the following possible values: 68k, amd64, arm, arm64, avr, ia32, ia64, irix, irix64, mips, mips64, pa-risc, ppc, sparc, sparc64.