# smms-cli

> Upload images to sm.ms

Latest version **0.4.0** (published 2018-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install smms-cli
pnpm add smms-cli
yarn add smms-cli
bun add smms-cli
```

Provides the command `smms`.

## 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.4.0 |
| Published | 2018-11-14 |
| First published | 2018-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 17.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 35 |
| Author | metowolf |
| Maintainers | metowolf |
| Keywords | smms, upload, images |

## Links

- npm: https://www.npmjs.com/package/smms-cli
- Repository: https://github.com/metowolf/smms-cli
- Homepage: https://github.com/metowolf/smms-cli#readme
- Issues: https://github.com/metowolf/smms-cli/issues
- npm.io page: https://npm.io/package/smms-cli

## Dependencies (8)

- [conf](https://npm.io/package/conf.md) ^2.1.0
- [glob](https://npm.io/package/glob.md) ^7.1.3
- [request](https://npm.io/package/request.md) ^2.88.0
- [commander](https://npm.io/package/commander.md) ^2.19.0
- [file-type](https://npm.io/package/file-type.md) ^10.4.0
- [cli-table3](https://npm.io/package/cli-table3.md) ^0.5.1
- [read-chunk](https://npm.io/package/read-chunk.md) ^3.0.0
- [request-promise](https://npm.io/package/request-promise.md) ^4.2.2

## 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.4.0 (latest) — 2018-11-14
- 0.3.0 — 2018-10-25
- 0.2.0 — 2018-10-23
- 0.1.1 — 2018-10-23
- 0.1.0 — 2018-10-23

## README

<p align="center">
<img src="https://user-images.githubusercontent.com/2666735/47508037-eea82300-d8a5-11e8-94b0-7c3496f04184.png" width="300px" alt="smms-cli">
</p>

<p align="center">
<a href="https://i-meto.com"><img alt="Author" src="https://img.shields.io/badge/Author-METO-blue.svg?style=flat-square"/></a>
<a href="https://www.npmjs.com/package/smms-cli"><img alt="Version" src="https://img.shields.io/npm/v/smms-cli.svg?style=flat-square"/></a>
<a href="https://travis-ci.org/metowolf/smms-cli"><img alt="Travis" src="https://img.shields.io/travis/metowolf/smms-cli.svg?style=flat-square"></a>
<img alt="License" src="https://img.shields.io/npm/l/smms-cli.svg?style=flat-square"/>
</p>


## Command-line Usage

### Installation

```bash
npm install smms-cli -g
```
or
```bash
yarn global add smms-cli
```

[![asciicast](https://asciinema.org/a/TDoMBDihP9caz0gc3CCYJRdkS.png)](https://asciinema.org/a/TDoMBDihP9caz0gc3CCYJRdkS)

### Usage

Upload a single image

```bash
smms dog.png
```

Upload multiple images ([globbing](https://www.npmjs.com/package/glob) supported)

```bash
smms "*.jpeg" dog.png
smms ~/*.(jpg|png|gif)
```

Delete image remote

```bash
smms --delete https://i.loli.net/2018/10/25/5bd1ce38cdec0.png
smms --delete OtE4waQ8erNikJ9
```

Show upload history

```bash
smms --list
smms --history
```

Clear upload history

```bash
smms --clear
```

Display smms-cli version:

```bash
smms --version
```

## Module Usage

### Installation

```bash
npm install smms-cli
```
or
```bash
yarn add smms-cli
```

### API

https://sm.ms/doc/

### Usage

#### Requiring the module:

```javascript
const smms = require('smms-cli')
```


#### Uploading files

```javascript
smms.upload('./test/nodejs.png')
    .then(json => {
        console.log(json)
    })
    .catch(err => {
        console.error(err.message)
    })
```

success response
```json
{
    "code": "success",
    "data": {
        "width": 512,
        "height": 512,
        "filename": "nodejs.png",
        "storename": "5bcf14f27edca.png",
        "size": 6538,
        "path": "/2018/10/23/5bcf14f27edca.png",
        "hash": "IJsRz2bQpvPr4lA",
        "timestamp": 1540297970,
        "ip": "35.201.144.6",
        "url": "https://i.loli.net/2018/10/23/5bcf14f27edca.png",
        "delete": "https://sm.ms/delete/IJsRz2bQpvPr4lA"
    }
}
```

#### Upload history

```javascript
smms.history()
    .then(json => {
        console.log(json.data)
    })
    .catch(err => {
        console.error(err.message)
    })
```

success response
```json
{
    "code": "success",
    "data": [
        {
            "width": 512,
            "height": 512,
            "filename": "nodejs.png",
            "storename": "5bcf14f27edca.png",
            "size": 6538,
            "path": "/2018/10/23/5bcf14f27edca.png",
            "hash": "IJsRz2bQpvPr4lA",
            "timestamp": 1540297970,
            "ip": "35.201.144.6",
            "url": "https://i.loli.net/2018/10/23/5bcf14f27edca.png",
            "delete": "https://sm.ms/delete/IJsRz2bQpvPr4lA"
        }
    ]
}
```

#### Clear upload history

```javascript
imgur.clear()
    .then(status => {
        console.log(status.msg);
    })
    .catch(err => {
        console.error(err.msg)
    })
```

#### Deleting upload

Delete an image based on the deletehash (generated during the image upload)

```javascript
imgur.delete(hash)
    .then(status => {
        console.log(status.msg);
    })
    .catch(err => {
        console.error(err.msg)
    })
```

## Author

**smms-cli** © [metowolf](https://github.com/metowolf), Released under the [MIT](./LICENSE) License.<br>

> Blog [@meto](https://i-meto.com) · GitHub [@metowolf](https://github.com/metowolf) · Twitter [@metowolf](https://twitter.com/metowolf) · Telegram Channel [@metooooo](https://t.me/metooooo)

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