Find closing symbol (parentheses, curly braces...)
npm i find-closing-symbol
var findClosingSymbolFactory = require('find-closing-symbol');
var findClosingParenthesis = findClosingSymbolFactory('(', ')');
findClosingParenthesis('2 + (5 + 1)) * 5'); // => 12
See spec.