code: function buildJSONAPI() {
  
    var SINGULAR_UNITS_REG = /^(year|month|week|day|hour|minute|second|millisecond)(?!s)/;
  
    var docs = getJSONDocs(), data = {};
  
    data.namespaces = docs.namespaces.map(function(ns) {
      return {
        name: ns.name,
        methods: ns.methods.map(function(m) {
          var p = {
            name: m.name,
            module: m.module
          };
          if (m.set) {
            p.set = m.set.filter(function(name) {
              return !SINGULAR_UNITS_REG.test(name);
            });
          }
          return p;
        })
      };
    });
  
    outputJSON('api.json', data);
  }
docs: -------------- JSON Docs ----------------