dschnelldavis / parse-full-name

A function that accepts the full name of a person in any format, parses it, and returns its parts { title, first name, middle name, last name, nickname, suffix, [and any parsing errors] }.
74 stars 15 forks source link

Non-standerd syntax #16

Closed coen22 closed 4 years ago

coen22 commented 4 years ago

Hi I'd like to keep using this in my web project, but your'e using Node syntax

Could you replace your first line with: export function parseFullName(

Don't know if that works in Node.js, but it does work with my PWA project.

vandie commented 4 years ago

Unfortunatly, what is currently in the codebase is standard syntax for NodeJS.

If you use a bundler such as webpack or rollup and use somthing like babel. It can ensure all libraries are using the correct syntax for you. While not a perfect solution @coen22, not all libraries are built with both ES6 & NodeJS in mind. Usually one or the other.

coen22 commented 4 years ago

All right, but I would personally never use Javascript on the server-side. Thanks for the script though, with a tiny change to an ES6 export it works perfectly.