https://github.com/silverbucket/webfinger.js
library for easily querying a useraddress for its webfinger record
https://github.com/silverbucket/webfinger.js
Last synced: 3 months ago
JSON representation
library for easily querying a useraddress for its webfinger record
- Host: GitHub
- URL: https://github.com/silverbucket/webfinger.js
- Owner: silverbucket
- License: lgpl-3.0
- Created: 2012-11-17T18:36:07.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-09-16T19:21:54.000Z (10 months ago)
- Last Synced: 2024-10-12T17:30:41.001Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 529 KB
- Stars: 51
- Watchers: 5
- Forks: 11
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webfinger.js
A WebFinger client that runs both in the browser and in node.js.
[](http://travis-ci.org/silverbucket/webfinger.js)
[](https://npmjs.org/package/webfinger.js)
[](https://npmjs.org/package/webfinger.js)
[](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: '