In previous versions of JShare, you had to call includeJShare() in your view, however this is now incompatible with EJS (thanks to minttoothpick for pointing this out). For backwards compatibility this will still work with Jade, however it is encouraged to use JShare() moving forward.

And finally, in your routes file, you can now attach any variables to the Response:

Now, in your client-side javascript, all of your variables that you set on the server side, will be available to you:

clientJS.js

alert(jshare.person.firstName);

Options:

When calling the jshare() function from within your app.js, you can optionally pass in a namespace parameter. What that does is it prefaces the Javascript variables (both client and server side) with your custom namespace as opposed to 'JShare':