Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/silverbucket/webfinger.js

library for easily querying a useraddress for its webfinger record
https://github.com/silverbucket/webfinger.js

Last synced: 13 days ago
JSON representation

library for easily querying a useraddress for its webfinger record

Awesome Lists containing this project

README

        

# webfinger.js

A WebFinger client that runs both in the browser and in node.js.

[![Build Status](http://img.shields.io/travis/silverbucket/webfinger.js.svg?style=flat)](http://travis-ci.org/silverbucket/webfinger.js)
[![license](https://img.shields.io/npm/l/webfinger.js.svg?style=flat)](https://npmjs.org/package/webfinger.js)
[![downloads](http://img.shields.io/npm/dm/webfinger.js.svg?style=flat)](https://npmjs.org/package/webfinger.js)
[![release](http://img.shields.io/github/release/silverbucket/webfinger.js.svg?style=flat)](https://github.com/silverbucket/webfinger.js/releases)

## Features

* defaults to TLS only

* optional URI fallback (for older services which use `host-meta` or `host-meta.json` URI endpoints)

* optional support for [WebFist](http://webfist.org)

## Initialize

### node.js
In node.js you should first require the module:

```javascript
var WebFinger = require('webfinger.js');
```

### Browser
When you include the `src/webfinger.js` script, a `WebFinger` object will be exposed.

## Use

```javascript
var webfinger = new WebFinger({
webfist_fallback: true, // defaults to false
tls_only: true, // defaults to true
uri_fallback: false, // defaults to false
request_timeout: 10000, // defaults to 10000
});

webfinger.lookup('[email protected]', function (err, p) {
if (err) {
console.log('error: ', err.message);
} else {
console.log(p);
}
});

// example output:
// {
// idx: {
// properties: {
// name: "Nick Jennings"
// },
// links: {
// avatar: [{ href: '' }],
// blog: [{ href: '' }],
// vcard: [href: '