0.1.3 • Published 9 years ago

nmcns v0.1.3

Weekly downloads
3
License
-
Repository
github
Last release
9 years ago

Namecoin Resolving Library

Join the chat at https://gitter.im/PlexRay/nmcns

The Namecoin Resolving Library provides a node.js/io.js dns module compatible interface to perform name resolution using the Namecoin Data Processing Library.

Supported Record Types:

A, AAAA, CNAME, SOA, TXT, NS, MX, SRV

Quick Examples

ES5

Resolving webrtc.bit/SOA/IN

var nmcns = require('nmcns');

nmcns.resolveSoa('webrtc.bit', function(err, soa) {
    console.log(soa);
});

ES7

Resolving _smtp._tcp.example.coin/SRV/IN

import nmcpp from 'nmcpp';
import nmcns from 'nmcns';

new nmcpp.TestProvider({
    gtld: 'coin',
    data: {
        "d/example": {
            "service": [
                [ "smtp", "tcp", 10, 0, 25, "mx.@" ],
            ],
        }
    }
});

ns = new nmcns.Resolver();

(async function() {
    var services = await ns.resolveSrvAsync('_smtp._tcp.example.coin');
    console.log(services);
}())

Tests

Examples

The MIT License (MIT)

Copyright (c) 2015 PlexRay, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.