Files: 012e32d5ba7c8cc7ea4d15234b2715ffc1f0e154 / named.js
530 bytesRaw
1 | // Copyright 2012 Iris Couch, all rights reserved. |
2 | // |
3 | // The dnsd package API |
4 | |
5 | var Message = require('./message') |
6 | var createServer = require('./server') |
7 | |
8 | module.exports = { 'parse': parse |
9 | , 'binify' : stringify |
10 | , 'stringify': stringify |
11 | , 'createServer': createServer |
12 | } |
13 | |
14 | function parse(packet) { |
15 | return new Message(packet) |
16 | } |
17 | |
18 | function stringify(message) { |
19 | if(! (message instanceof Message)) |
20 | message = new Message(message) |
21 | return message.toBinary() |
22 | } |
23 |
Built with git-ssb-web