blob: 9363ba04bfc4468b7fb5d64b7defe3b9e5aced53 [file] [log] [blame]
Jeff Burkee29f2af2012-12-08 12:15:22 -08001NDN.JS: A javascript client library for Named Data Networking
Alexander Afanasyev57dce8b2013-02-28 19:20:21 -08002-------------------------------------------------------------
Jeff Burke0f418d02012-12-08 12:14:41 -08003
Alexander Afanasyev57dce8b2013-02-28 19:20:21 -08004BASIC LIBRARY: NO BUILD REQUIRED
5================================
Jeff Burkeacb3b3d2012-12-08 12:17:41 -08006The basic NDN.JS library does not need to be "built". For the library, you can manually
7include the necessary scripts in a web page or include Helper.js to have it load all of
8the scripts.
Jeff Burke0f418d02012-12-08 12:14:41 -08009
Alexander Afanasyev57dce8b2013-02-28 19:20:21 -080010BUILD A COMBINED, COMPRESSED LIBRARY
11====================================
12
Jeff Burkee29f2af2012-12-08 12:15:22 -080013A more efficient way to include the library is to used the combined, compressed library
14ndn-js.js that can be made using the js/tools/build/make-js.sh script. See the README in
15that directly. While we try to keep a built version in that directory for convenience, it
16may fall out of sync with the library, so we recommend building it using the script if
17possible.
18
Alexander Afanasyev57dce8b2013-02-28 19:20:21 -080019To create a combined and optionally compressed version of NDN.JS scripts:
20
Alexander Afanasyev426174a2013-03-13 16:45:47 -070021 ./waf configure --no-ws --prefix=<PREFIX_TO_INSTALL_JS>
Alexander Afanasyev57dce8b2013-02-28 19:20:21 -080022 ./waf install
23
24These commands will create a combined version, combined version compressed using Google's
25Closure Compiler, and install it into <PREFIX_TO_INSTALL_JS> folder.
26
27The compressed version is what we recommend including in applications.
28
Jeff Thompson232f2892013-07-29 15:38:16 -070029DOCUMENTATION
30================
31The documentation is auto-generated using JSDoc. If you don't have JSDoc installed, download and unzip from:
32https://github.com/jsdoc3/jsdoc/archive/master.zip
33
34To make doc, cd to the root directory of ndn-js and run the following command to put the output in subdirectory doc:
35<path-to-jsdoc>/jsdoc --recurse --destination doc js
Alexander Afanasyev57dce8b2013-02-28 19:20:21 -080036
37WEBSOCKETS PROXY
38================
39
Jeff Burkee29f2af2012-12-08 12:15:22 -080040If you wish to run your own WebSockets proxy instead of using the NDN testbed, you must
41build and install Node.js (often on the machine also running the ccnd you wish to proxy
Jeff Burke9c950af2012-12-08 12:18:54 -080042for, but that doesn't have to be the case). See wsproxy/README.md
Jeff Burke0f418d02012-12-08 12:14:41 -080043
Alexander Afanasyev57dce8b2013-02-28 19:20:21 -080044THE FIREFOX ADD-ON
45==================
46
Alexander Afanasyev426174a2013-03-13 16:45:47 -070047Build first compressed version of NDN.js
48
49 ./waf configure
50 ./waf
51
52Then go to ndnProtocol and run ./make-ndnProtocol.sh which makes ndnProtocol.xpi.
Alexander Afanasyev57dce8b2013-02-28 19:20:21 -080053