Install with npm:
$ npm install --save truncatewallet
Works with strings.
const truncatewallet = require('truncatewallet');
console.log(truncatewallet('0x41a7e9787baB84eAa6f21b6c15dca30FE630684C')); //=> '0x41a7...684C'
Released under the MIT License.