nSQL([
  {a:1,b:10}, 
  {a:2,b:20}, 
  {a:1,b:40}
])
.query("select", ["a", "SUM(b) AS b"])
.groupBy(["a ASC"])
.exec().then(function(result) {
  var elem = document.createElement("pre");
  document.body.appendChild(elem);
  elem.innerHTML = JSON.stringify(result, null, 4)
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.1.1/es6-promise.auto.min.js
  2. https://cdn.jsdelivr.net/npm/@nano-sql/core@2.2.7/dist/nano-sql.min.es5.js