blob: da4ab4cca2454cd4e302cf02e5bf0fde250a3ea9 [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
21 ./waf configure --no-ws --prefix=<PREFIX_TO_INSTALL_JS> --compiler
22 ./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
29
30WEBSOCKETS PROXY
31================
32
Jeff Burkee29f2af2012-12-08 12:15:22 -080033If you wish to run your own WebSockets proxy instead of using the NDN testbed, you must
34build and install Node.js (often on the machine also running the ccnd you wish to proxy
Jeff Burke9c950af2012-12-08 12:18:54 -080035for, but that doesn't have to be the case). See wsproxy/README.md
Jeff Burke0f418d02012-12-08 12:14:41 -080036
Alexander Afanasyev57dce8b2013-02-28 19:20:21 -080037THE FIREFOX ADD-ON
38==================
39
Jeff Thompson4c6d92c2012-12-09 12:51:25 -080040If the compressed library js/tools/build/ndn-js.js is out of date, first build it (see above).
Alexander Afanasyev57dce8b2013-02-28 19:20:21 -080041Go to js/ndnProtocol and run make-ndnProtocol.sh which makes js/ndnProtocol.xpi.
42