ndn-contrib

0.1.18 • Public • Published

NDN-Contrib - Expanded Class Library on top of NDN-js

NDN-js offers the common client Named Data Networking library in pure javascript. This is an expansion upon that work, offering a modular set of javascript 'classes' for building NDN enabled apps in Node.js, the browser, and even exciting runtimes like breach and atom-shell.

  • DataStructures

    • NameTree
    • ContentStore with modular entries for caching, database indexing, etc.
    • PIT - Pending Interest Table with modular entry options (callbacks or integer IDs)
    • FIB - Forwarding Interest Base
    • Interfaces - Interface manager accepting any combination of transports
  • Transports -

Usage

simply require("ndn-contrib") in your project (use browserify for browser projects)

var ndn = require("ndn-contrib");

all the classes are now attached to the ndn object (including ndn-js @ ndn.ndn), and are ready to go...

var myInterfaces = new ndn.Interfaces(/*Subject*/)
ndn.WebSocketServer.defineListener();
myInterface.installProtocol(ndn.WebSocketServer);

now you have a websocket server accepting incoming connections and handing interest and data packets to your subject! For more, detail see the full documentation.

You can also include just part of the library by doing something like

var ndn = require("ndn-lib");
var Interfaces = require("ndn-contrib/src/DataStructures/Interfaces.js");
Interfaces.installNDN(ndn); /** This is done for you if you require("ndn-contrib"),
                             * it's a safety measure to avoid 'instanceof' bugs.
                             */

Contributing

grunt watch // do everything automatically while coding
grunt suite // run all the tests
grunt jsdoc // generate documentation

Bug reports and pull requests welcome! lint, doc, and test are all registered tasks in Gruntfile.js, and will run automatically for you when you use grunt watch. Browser tests are also assembled via grunt in the test/browser directory, and have a livereload script that will re-compile and run them when watch is running. Happy hacking!

License

LGPL (vTBD)

Contact

Ryan Bennett, Colorado State University. nomad.ry@gmail.com

Package Sidebar

Install

npm i ndn-contrib

Weekly Downloads

0

Version

0.1.18

License

LGPLvTBD

Last publish

Collaborators

  • rynomad