code: function getNodejsId(text, repetition) {
    text = text.replace(/[^a-z0-9]+/g, '_');
    text = text.replace(/^_+|_+$/, '');
    text = text.replace(/^([^a-z])/, '_$1');
  
    // If no repetition, or if the repetition is 0 then ignore. Otherwise append '_' and the number.
    // An example may be found here: http://nodejs.org/api/domain.html#domain_example_1
    if (repetition) {
      text += '_' + repetition;
    }
  
    return text;
  }
docs: https://github.com/joyent/node/blob/192192a09e2d2e0d6bdd0934f602d2dbbf10ed06/tools/doc/html.js#L172-L183