New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

webfinger-client

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webfinger-client

[![NPM version][npm-image]][npm-url]

latest
npmnpm
Version
1.0.2
Version published
Maintainers
2
Created
Source

webfinger-client

NPM version

A webfinger client that runs both in the browser and in node.js. The Client is based on Nick Jennings library webfinger.js but has been rewritten in TypeScript.

Demo

Check out the Demo at GitHub Pages: 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

Demo

clone this repository, run npm install and finally npm start

Install

Install the client as a dependency:

npm install --save webfinger-client

Usage

Import

You have to import the module before using it:

import { WebFinger } from 'webfinger';

Use

  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('alice@example.org', function (err, p) {
    if (err) {
      console.log('error: ', err.message);
    } else {
      console.log(p);
    }
  });


// example output:
// {
//   idx: {
//     properties: {
//       name: "Alice Henderson"
//     },
//     links: {
//       avatar: [{ href: '<url>' }],
//       blog: [{ href: '<url>' }],
//       vcard: [href: '<url' }]
//       ... etc.
//     },
//   }
//   json: { ... raw json output ... }
//   object: { ... unformatted but parsed into native javascript object ... }
// }

  webfinger.lookupLink('alice@example.org', 'remotestorage' function (err, p) {
    if (err) {
      console.log('error: ', err.message);
    } else {
      console.log(p);
    }
  });

// example output (if at least one link with rel="remotestorage" exists):
// {
//   href: 'https://storage.5apps.com/alice',
//   rel : 'remotestorage',
//   properties: {
//     'http://remotestorage.io/spec/version': 'draft-dejong-remotestorage-02',
//     'http://tools.ietf.org/html/rfc6749#section-4.2': 'https://5apps.com/rs/oauth/alice',
//     'http://tools.ietf.org/html/rfc6750#section-2.3': false,
//     'http://tools.ietf.org/html/rfc2616#section-14.16': false
//   }
// }

Development

The library is built with Webpack. Notes for building and serving can be fount in DEVELOPMENT.

FAQs

Package last updated on 13 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts