# @jbaldwin/craiyon

> Craiyon (ex DALL-E Mini) API client library for Node.js

Latest version **1.1.0** (published 2023-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jbaldwin/craiyon
pnpm add @jbaldwin/craiyon
yarn add @jbaldwin/craiyon
bun add @jbaldwin/craiyon
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2023-04-20 |
| First published | 2023-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 32.9 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | József Sallai @jozsefsallai |
| Maintainers | jbaldwin |
| Keywords | craiyon, image generation, api client |

## Links

- npm: https://www.npmjs.com/package/@jbaldwin/craiyon
- Repository: https://github.com/HuFlungDu/node-craiyon
- Homepage: https://github.com/HuFlungDu/node-craiyon#readme
- Issues: https://github.com/HuFlungDu/node-craiyonissues
- npm.io page: https://npm.io/package/@jbaldwin/craiyon

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.27.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

- 1.1.0 (latest) — 2023-04-20
- 1.0.0 — 2023-04-11

## README

# node-craiyon

Unofficial Node.js API client for [Craiyon][craiyon-url] (formerly DALL-E Mini).

## Getting Started

Install the module using npm:

```
npm install craiyon
```

or Yarn:

```
yarn add craiyon
```

## Basic Usage

```js
const { Client } = require('craiyon');

const craiyon = new Client();
const result = await craiyon.generate({
  prompt: 'Painting of a dachshund drinking water in the style of Van Gogh',
});
```

You can then use any of the methods available in `result` to get the generated
images in any way you want.

You can learn more about the supported methods in the [documentation][docs-url].

## Customization

By default, the library will retry a request 3 times if something goes wrong.
You may change this behavior either by instantiating the client with a custom
number of maximum retries (for all generations):

```js
const craiyon = new Client().withMaxRetries(5);
```

or by setting a custom number of retries for a specific generation:

```js
const result = await craiyon.generate({
  prompt: 'Painting of a dachshund drinking water in the style of Van Gogh',
  maxRetries: 5,
});
```

## Notice

Please note that this is using a reverse-engineered backend endpoint provided by
Craiyon. The endpoint could, at any point in time, change the request and/or
response, or become unavailable for public use altogether. If you encounter any
problems with the library, please open an issue on [GitHub][github-issues-url].

## For Contributors

`node-craiyon` is written in TypeScript, therefore, you have to compile it to
JavaScript if you'd like to test your changes. You may do so using the following
command:

```
npm run build
```

The library does not currently employ any unit testing measures, however, if you
would like to contribute to the library, please make sure that your changes pass
linting. You can run the following command to check:

```
npm run lint
```

## License

MIT. Please read the LICENSE file for more information.

[craiyon-url]: https://www.craiyon.com/
[docs-url]: https://jozsefsallai.github.io/node-craiyon/
[github-issues-url]: https://github.com/jozsefsallai/node-craiyon/issues

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