how to fetch first 10 characters of a string in node js

JavaScript
var str = '12345678value';
var strshortened = str.slice(0,8);
Source

Also in JavaScript: