@litert/gravatar
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

LiteRT/Gravatar

npm version License

A toolkits for using gravatar.

Requirement

  • TypeScript v2.6.1 (or newer)

Installation

Install by NPM:

npm i @litert/gravatar --save

Usage

Here is an example for Node.js: (in TypeScript)

import * as gravatar from "@litert/gravatar";
import * as crypto from "crypto";

// before using it, please inject a MD5 function, e.g.
gravatar.setMD5Function(function(email: string): string {

    let hasher = crypto.createHash("md5");

    hasher.update(email);

    return hasher.digest().toString("hex");
});

console.log(gravatar.getAvatarUrl("i.am.x.fenying@gmail.com"));

License

This library is published under MIT license.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.10latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.10
0.1.00

Package Sidebar

Install

npm i @litert/gravatar

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

53 kB

Total Files

23

Last publish

Collaborators

  • fenying