node.js - How do I share javascript on the server as well the client? -


lot of time end repeating code on server client. example have registration form; validations required field, email address regex same on both server , client. ideally want write code in 1 place , not repeat.

if you're using express.js, take @ express-expose module. seems you're looking for:

expose objects, functions, modules , more client-side js


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -