# puush

> A simple wrapper for the puush API

Latest version **0.1.9** (published 2014-05-27) · MIT license · 0 weekly downloads

## Install

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

## 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.9 |
| Published | 2014-05-27 |
| First published | 2014-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | juno |
| Keywords | puush, archive, backup, file, sharing, upload |

## Links

- npm: https://www.npmjs.com/package/puush
- npm.io page: https://npm.io/package/puush

## Dependencies (1)

- [request](https://npm.io/package/request.md) ~2.34.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.1.9 (latest) — 2014-05-27
- 0.1.8 — 2014-05-19
- 0.1.7 — 2014-05-19
- 0.1.6 — 2014-05-19
- 0.1.5 — 2014-05-19
- 0.1.4 — 2014-05-17
- 0.1.3 — 2014-05-17
- 0.1.2 — 2014-05-05
- 0.1.1 — 2014-05-05
- 0.1.0 — 2014-05-03

## README

# node-puush

Simple wrapper for [puush](http://puush.me/).

---
* [Puush](#puushapikey) ([apiKey]) - Constructor, apiKey is optional.
* [auth](#authemail-password--callback) (email, password [, callback]) - Authenticate user. API key saved on success.
* [auth_key](#auth_keyemail-apikey--callback) (email, apikey [, callback]) - Same as `auth()`, using apikey instead of plain text password.
* [up](#upfilename--callback) (filename [, callback]) - Upload file. Maximum filesize for free account: 272629051 bytes
* [del](#delfileid--callback) (fileID [, callback]) - Remove uploaded file.
* [hist](#histcallback) ([callback]) - List of previously uploaded files. Limited to 10 on server side.

### Example
```javascript
var Puush = require('puush');

var puush = new Puush();
// or, if you know your API Key already:
var puush = new Puush('YOURAPIKEY');

// callback function to show results
function showResult(err, result) {
  console.log(result)
};

puush.auth('your@email.net', 'SuperSecretPassword');
// or
puush.auth_key('your@email.net', 'YOURAPIKEY');

puush.up('yourfile.ext', showResult);
puush.hist(showResult); // limited to 10 on server side
puush.del(12345678, showResult);
```
---
### `Puush([apiKey])`
Constructor, apiKey is optional.

---
#### `auth(email, password [, callback])`
Authenticate user. API key saved on success.
##### Result from callback:
```javascript
{ premium: 0,           // account is premium (?)
  apiKey: 'YOURAPIKEY', // API key of the user
  expire: '',           // premium expiration date (?)
  sizeSum: 0 }          // sum of file sizes (?)
```

#### `auth_key(email, apikey [, callback])`
Same as `auth()`, using apikey instead of plain text password.

---
#### `up(filename [, callback])`
Upload a file.  
Maximum file size for free account: 260MB-708B-filename.length,  
if your filename is only 1 character, then it is: 272629051 bytes
##### Result from callback:
```javascript
{ id: 123465,                // uploaded file id
  url: 'http://puu.sh/x/y' } // download url
```

#### `del(fileID [, callback])`
Remove uploaded file. Result is the same as `hist()`.

#### `hist([callback])`
List of previously uploaded files.
Limited to 10 on server side.
##### Result from callback:
```javascript
[ { id: 123456,               // uploaded file id
    datetime: 'Wed Jan 01 2014 00:00:00 GMT', // upload datetime
    url: 'http://puu.sh/x/y', // download url
    filename: 'yourfile.txt', // name of the uploaded file
    views: 1 },               // number of views
  { // more files...
  }
]
```

##Notes
- If you include your API key in the constructor, you dont have to auth.
- Question marked properties at callback results are wild guesses.

##Todo
- Constructor ([email, password]|[apiKey])
- Implement `thumb`
- `raw` property at result, for unparsed response

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