# gravitate

> Yet another node library for Gravatar with support for both the photo and profile APIs.

Latest version **1.1.0** (published 2015-04-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install gravitate
pnpm add gravitate
yarn add gravitate
bun add gravitate
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2015-04-04 |
| First published | 2013-07-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+9 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dennis Torres |
| Maintainers | psirenny |
| Keywords | node, gravatar |

## Links

- npm: https://www.npmjs.com/package/gravitate
- Repository: https://github.com/psirenny/gravitate
- Issues: https://github.com/psirenny/gravitate/issues
- npm.io page: https://npm.io/package/gravitate

## Dependencies (4)

- [qs](https://npm.io/package/qs.md) ^2.3.2
- [lodash](https://npm.io/package/lodash.md) ^2.4.1
- [superagent](https://npm.io/package/superagent.md) ^0.20.0
- [email-addresses](https://npm.io/package/email-addresses.md) ^1.1.2

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2015-04-04
- 1.0.0 — 2014-11-24
- 0.5.0 — 2014-10-29
- 0.4.2 — 2014-10-29
- 0.4.1 — 2014-09-15
- 0.4.0 — 2014-09-15
- 0.3.1 — 2014-08-11
- 0.3.0 — 2014-08-10
- 0.2.1 — 2014-01-27
- 0.2.0 — 2013-07-28

## README

Gravitate
=========

Yet another node library for [Gravatar](http://en.gravatar.com) with support for both the **photo** and **profile** APIs.

[![Build Status](https://travis-ci.org/psirenny/gravitate.png?branch=master)](https://travis-ci.org/psirenny/gravitate)

Hash
----

Although all of the gravitate functions can accept an email, there is still a hash function available for your use.
If the input has already been hashed then it will just return the value.

```javascript
var gravitate = require('gravitate');
var email = 'email@address.com';
var hash = gravitate.hash(email); // "63b91ca4ec19ad79f320eaf5815d75e9"
```

**ignorePlus** - Ignore characters after and including a *+* sign. Defaults to `true`.

Images
------

```javascript
var hash = '63b91ca4ec19ad79f320eaf5815d75e9';
var imageUrl = gravitate.image.url(hash); // "https://secure.gravatar.com/avatar/63b91ca4ec19ad79f320eaf5815d75e9"
```

All functions also accept an email:

```javascript
var email = 'email@address.com';
var imageUrl = gravitate.image.url(email); // "https://secure.gravatar.com/avatar/63b91ca4ec19ad79f320eaf5815d75e9"
```

Image and profile urls are secure by default.
You can toggle SSL by setting the **secure** property in options to *true* or *false*.

```javascript
var email = 'email@address.com';
var imageUrl = gravitate.image.url(email, {secure: false}); // "http://www.gravatar.com/avatar/63b91ca4ec19ad79f320eaf5815d75e9"
```

All of the [standard url options](http://en.gravatar.com/site/implement/images/) are also available either through their full or abbreviated name:

```javascript
var email = 'email@address.com';
var imageUrl = gravitate.image.url(email, {
  default: 'monsterid',
  r: 'pg'
});
```

Profiles
--------

Profile urls work the same way as image urls and also accept a **secure** parameter:

```javascript
var email = 'email@address.com';
var profileUrl = gravitate.profile.url(email); // "https://secure.gravatar.com/63b91ca4ec19ad79f320eaf5815d75e9.json"
```

Often times you'll want the actual data and not url.
You can get the profile data with the following function:

```javascript
var email = 'email@address.com';
var profileUrl = gravitate.profile.data(email, function (err, data) {
  if (err) return;
  console.log(data.entry[0]); // {hash: '...', photos: [], ...}
});
```

---
_Source: https://npm.io/package/gravitate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
