# twitface

> Twitter avatar API client

Latest version **0.1.1** (published 2012-07-24) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2012-07-24 |
| First published | 2012-07-23 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ~0.8.2 |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mark Dalgleish |
| Maintainers | markdalgleish |
| Keywords | twitter, avatar, profile |

## Links

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

## Dependencies (2)

- [q](https://npm.io/package/q.md) ~0.8.5
- [request](https://npm.io/package/request.md) ~2.9.203

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2012-07-24
- 0.1.0 — 2012-07-23

## README

# twitface

Twitter avatar API client for Node.js [![Build Status](https://secure.travis-ci.org/markdalgleish/twitface.png)](http://travis-ci.org/markdalgleish/twitface)

## Setup

Install the module with: `npm install twitface`

## Basic Usage

```javascript
var twitface = require('twitface');

twitface.load('markdalgleish', function(err, url) {
	console.log(url); // Avatar URL ('normal' size)
});
```

## Requesting multiple images

```javascript
twitface.load(['markdalgleish', 'ryah'], function(err, urls) {
	console.log(urls); // Array of avatar URLs ('normal' size)
});
```

## Request a specific size

Requesting a single image:

```javascript
twitface.load('markdalgleish', 'bigger', function(err, url) {
	console.log(url); // Avatar URL
});
```

Requesting multiple images:

```javascript
twitface.load(['markdalgleish', 'ryah'], 'bigger', function(err, urls) {
	console.log(urls); // Array of avatar URLs
});
```

Twitter offers the following sizes:

* `original` (Original upload size)
* `mini` (24x24)
* `normal` (48x48)
* `bigger` (73x73)
* `reasonably_small` (128x128 - Don't ask me, ask Twitter…)

## Modify the default size

By default, 'normal' avatar URLs are returned. This default can be changed with `setDefaultSize`:

```javascript
twitface.setDefaultSize('reasonably_small');

twitface.load('markdalgleish', function(err, url) {
	console.log(url); // Avatar URL (128x128)
});
```

## Modify the cache expiry duration

By default, avatar URLs are cached for 24 hours to limit the amount the API is hit.

You can modify how long URLs are cached with `setExpiryDuration`:

```javascript
twitface.setExpiryDuration(1000 * 60 * 60); // Cache for 60 minutes
```

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).

## License
Copyright (c) 2012 Mark Dalgleish  
Licensed under the MIT license.

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