-
Notifications
You must be signed in to change notification settings - Fork 72
Programming With ForerunnerDB
ForerunnerDB is a large JavaScript project that is broken into many separate files representing different classes and mixins. This makes the project manageable from a source control and separation of concerns point of view.
The entire application is written using the Node.js module definition standard (CommonJS). The CommonJS require() method allows module dependencies to be included where they are needed. Browsers do not support require() so to generate a browser-compatible version of ForerunnerDB we run it through Browserify. Browserify is a post-process application that takes your Node.js code, reads all the dependencies and packages it all up into a single file for use in browsers.
If you wish to extend ForerunnerDB you should start by doing so in Node.js first, then use Browserify to generate a browser-based version of your extension. This allows your code to run in both server-side and client-side environments without any source code voodoo.
The source code for ForerunnerDB is documented in-line via JSDoc comments. A post-processor runs over this source code and generates the documentation found in the /doc folder. The readme.md should be considered the "Manual" for the application while the /doc folder contains the class and method specific information including parameters and return values.
The project has developer dependencies that can be installed via:
npm install --dev
These dependencies are not required by the production version of ForerunnerDB so are not installed by default when running a standard npm install forerunnerdb.