This is the test of writing JavaScript library which can be used on client and server side simultaneously.
NPM dependencies and CommonJS require
used.
Server side environment expected to be NodeJS.
Client side supported with Ender.
lib-common - common functionality for server and client.
lib-server, lib-client - server and client side wrapper of lib-common.
test-serever, test-client - server and client side lib consumers.
All packages are not in NPM repository, so we need to manually link all dependencies.
sh ./link-libs
This step is optional, result included in source.
sudo npm install ender -g
cd test-client
ender build
Open /test-client/test.html
in your browser.
cd test-server
node main.js