pure JavaScript to parse LDIF file