Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

@litert/gravatar

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.

Install

npm i @litert/gravatar

DownloadsWeekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

53 kB

Total Files

23

Last publish

Collaborators

  • avatar
  • avatar
  • avatar