Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/d-koppenhagen/webfinger

A webfinger client written in TypeScript
https://github.com/d-koppenhagen/webfinger

client identity javascript library typescript webfinger

Last synced: 23 days ago
JSON representation

A webfinger client written in TypeScript

Awesome Lists containing this project

README

        

# webfinger-client
[![NPM version][npm-image]][npm-url]

A webfinger client that runs both in the browser and in node.js.
The Client is based on Nick Jennings library [webfinger.js](https://github.com/silverbucket/webfinger.js) but has been rewritten in TypeScript.

## Demo
Check out the Demo at GitHub Pages: [https://d-koppenhagen.github.io/webfinger/](https://d-koppenhagen.github.io/webfinger/)

## 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)

## Demo
clone this repository, run `npm install` and finally `npm start`

## Install
Install the client as a dependency:

```bash
npm install --save webfinger-client
```

## Usage
### Import
You have to import the module before using it:

```typescript
import { WebFinger } from 'webfinger';
```

### Use
```typescript
let webfinger = new WebFinger({
webfistFallback: true, // defaults to false
tlsOnly: true, // defaults to true
uriFallback: false, // defaults to false
requestTimeout: 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: "Alice Henderson"
// },
// links: {
// avatar: [{ href: '' }],
// blog: [{ href: '' }],
// vcard: [href: '