# ascli

> A uniform foundation for unobtrusive (ASCII art in) cli apps.

Latest version **1.0.1** (published 2016-11-05) · Apache-2.0 license · 0 weekly downloads

## Install

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

## 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.0.1 |
| Published | 2016-11-05 |
| First published | 2013-05-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Daniel Wirtz |
| Maintainers | dcode |
| Keywords | ansi, terminal, colors, ascii |

## Links

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

## Dependencies (2)

- [optjs](https://npm.io/package/optjs.md) ~3.2.2
- [colour](https://npm.io/package/colour.md) ~0.7.1

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-11-05
- 1.0.0 — 2014-11-04
- 0.3.0 — 2013-05-28
- 0.2.0 — 2013-05-03
- 0.1.0 — 2013-05-03

## README

![ascli](https://raw.github.com/dcodeIO/ascli/master/ascli.png)
=====
**Why?** Some of us are not only programmers but also part-time artist. So am I. This is good. However, to limit myself
a bit to a straight look of my CLI apps, I've created ascli based on the thought of not making things too fancy but
still looking good. So, basically, this package is meant to be used by me but if you like my interpretation of
unobtrusiveness and ease-of-use ... You are welcome!

<p align="center">
    <img src="https://raw.github.com/dcodeIO/ascli/master/example.png" alt="example" />
</p>

Installation
------------
`npm install ascli`

Usage
-----
```js
var cli = require("ascli")("myAppName");
cli.banner(ascli.appName.green.bold, "v1.0.0 by Foo Bar <foobar@example.com>");
cli.log("Hello!");
cli.info("World!");
cli.warn("of");
cli.error("ascli.");
// If it worked:
cli.ok("It worked!", /* optional exit code */ 0);
// If it didn't:
cli.fail("Nope, sorry.", /* optional exit code */ 1);
```

#### Using another alphabet
By default ascli uses a modified version of the **straight** ASCII alphabet. If you don't like it, you are free to
replace it:

```js
cli.use("/path/to/my/alphabet.json");
// or
var myAlphabet = { ... };
cli.use(myAlphabet);
```

See the `alphabet/` directory for an example.

#### Using colors
ascli automatically looks up and translates ANSI terminal colors applied to the title string. For that it depends on
[colour.js](https://github.com/dcodeIO/colour.js) which is also exposed as a property of the ascli namespace:
`cli.colour` / `cli.colors`. Also means: You don't need another ANSI terminal colors dependency.

#### Indentation
`cli.log` etc. indents all console output by one space just because it looks better with the banner.

Parsing command line arguments
------------------------------
[opt.js](https://github.com/dcodeIO/opt.js) will be pre-run on the `cli` namespace and also exposed as `cli.optjs()`.
```js
cli.node   // Node executable
cli.script // Executed script
cli.opt    // Options as a hash
cli.argv   // Remaining non-option arguments
```

License
-------
Apache License, Version 2.0

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