# imgbi

> Simple command-line client and Node.js library for use img.bi.

Latest version **0.0.6** (published 2015-07-27) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

Provides the command `imgbi-client`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2015-07-27 |
| First published | 2013-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+4 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 33 |
| Author | Anton Nesterov |
| Maintainers | anton.nesterov |
| Keywords | img.bi, uploader, downloader, crypto, image, images |

## Links

- npm: https://www.npmjs.com/package/imgbi
- Repository: https://github.com/imgbi/imgbi-client
- Homepage: https://github.com/imgbi/imgbi-client#readme
- Issues: https://github.com/imgbi/imgbi-client/issues
- npm.io page: https://npm.io/package/imgbi

## Dependencies (8)

- [cli](https://npm.io/package/cli.md) ~0.8.0
- [tmp](https://npm.io/package/tmp.md) 0.0.26
- [mime](https://npm.io/package/mime.md) ~1.3.4
- [sjcl](https://npm.io/package/sjcl.md) ^1.0.3
- [needle](https://npm.io/package/needle.md) ^0.10.0
- [datauri](https://npm.io/package/datauri.md) ~0.7.1
- [imagemagick](https://npm.io/package/imagemagick.md) ~0.1.3
- [passwordgen](https://npm.io/package/passwordgen.md) ^0.3.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.0.6 (latest) — 2015-07-27
- 0.0.5 — 2015-05-11
- 0.0.4 — 2014-05-04
- 0.0.3 — 2014-02-11
- 0.0.2 — 2013-12-02
- 0.0.1 — 2013-11-21

## README

# imgbi-client
Simple command-line client and Node.js library for use [img.bi](https://img.bi).

## Install

    npm install imgbi -g

## Usage

~~~ sh
$ imgbi-client -i image.png
https://img.bi/#!XqL4IVp!jxJccrgkodebbxlaplteabgtbkllab5tberiWkam
https://img.bi/rm/#!XqL4IVp!jxJccrgkodebbxlaplteabgtbkllab5tberiWkam!Rl80pmqeXIgRhZz9TQvCrYLAIAi

$ imgbi-client -d 'https://img.bi/#!XqL4IVp!jxJccrgkodebbxlaplteabgtbkllab5tberiWkam' -o images
OK: Saved to XqL4IVp.png

$ imgbi-client -r 'https://img.bi/rm/#!XqL4IVp!jxJccrgkodebbxlaplteabgtbkllab5tberiWkam!Rl80pmqeXIgRhZz9TQvCrYLAIAi'
OK: Removed

~~~

## --help

    Usage:
      imgbi-client [OPTIONS] [ARGS]

    Options: 
      -i, --image FILE       Image location
      -r, --remove URL       URL of file to be removed
      -d, --download URL     URL of file to be downloaded and decrypted
      -e, --expire [NUMBER]  Set expire time in days for image, 0 for store forever  (Default is 180)
      -o, --output [PATH]    Location to save file (Default is .)
      -u, --url [URL]        URL of img.bi instance (Default is https://img.bi)
      -n, --norm             Don't print removal link
      -l, --nolink           Don't print link to show image
      -a, --autorm           Print autoremove link
      -em, --embed           Print embed code
      -k, --no-color         Omit color from output
          --debug            Show debug information
      -h, --help             Display help and usage details


## Programmatic usage
### Uploading

~~~ js
var imgbi = require('imgbi');
var options = {};
options.image = 'image.jpg'; // image location
options.expire = '180'; // time to expire in days, default 180
options.url = 'https://img.bi'; // url of img.bi server, https://img.bi by default

imgbi.upload(options, function(err, result) {
  if (err) {
    new Error(err); // if there any error during the upload
  }
  else {
    console.log(result.id); // id of file
    console.log(result.pass); // pass used for encryption
    console.log(result.removalpass); // pass for remove file
    console.log(result.viewlink); // link to view image
    console.log(result.rmlink); // link to remove image
    console.log(result.autormlink); // link to autoremove image after first view
    console.log(result.embedcode); // code to embed image using img.bi.js script
  }
});
~~~

### Removing

~~~ js
imgbi = require('imgbi');

var url = 'https://img.bi/rm/#!XqL4IVp!jxJccrgkodebbxlaplteabgtbkllab5tberiWkam!Rl80pmqeXIgRhZz9TQvCrYLAIAi'; // link to remove image

imgbi.remove(url, function(err) {
  if (err) {
    new Error(err); // if there any error during the remove
  }
  else {
    console.log('Removed');
  }
});
~~~

### Downloading

~~~ js
imgbi = require('imgbi');

var url = 'https://img.bi/#!XqL4IVp!jxJccrgkodebbxlaplteabgtbkllab5tberiWkam'; // link to view image
var path = '~/images'; // path to save image

imgbi.download(url, path, function(err, result) {
  if (err) {
    new Error(err); // if there any error during the download
  }
  else {
    console.log(result); // filename
  }
});
~~~

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