A N-API version of https://github.com/juliangruber/balanced-match
Node.js v8
npm install git+https://github.com/shivanth/balanced-match-native.git
var balanced = require('balanced-match-native');
balanced('{', '}',"1{234}5")
//{start:1, end:5,pre:"1", post:"5",body:"234"}
balanced('{{{', '}}',"123{{{234}}")
// {start:3, end:9,pre:"123", post:"",body:"234"}
Regex is not supported yet for the first two arguments of balanced.