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
Post a Comment