# @google-cloud/typeless-sample-bot

> Google Cloud GitHub bot that converts TypeScript snippets into JavaScript

Latest version **4.1.0** (published 2026-10-12) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @google-cloud/typeless-sample-bot
pnpm add @google-cloud/typeless-sample-bot
yarn add @google-cloud/typeless-sample-bot
bun add @google-cloud/typeless-sample-bot
```

Provides the command `typeless-sample-bot`.

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.1.0 |
| Published | 2026-10-12 |
| First published | 2022-08-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 9 |
| Unpacked size | 54.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3210 |
| Author | Google LLC |
| Maintainers | google-wombot, google-admin |

## Links

- npm: https://www.npmjs.com/package/@google-cloud/typeless-sample-bot
- Repository: https://github.com/googleapis/google-cloud-node
- Homepage: https://github.com/googleapis/google-cloud-node#readme
- Issues: https://github.com/googleapis/google-cloud-node/issues
- npm.io page: https://npm.io/package/@google-cloud/typeless-sample-bot

## Dependencies (9)

- [chalk](https://npm.io/package/chalk.md) ^5.4.1
- [debug](https://npm.io/package/debug.md) ^4.4.0
- [yargs](https://npm.io/package/yargs.md) ^17.7.2
- [recast](https://npm.io/package/recast.md) ^0.23.11
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.26.9
- [@babel/traverse](https://npm.io/package/@babel/traverse.md) ^7.26.9
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.26.9
- [@babel/preset-typescript](https://npm.io/package/@babel/preset-typescript.md) ^7.26.0
- [@babel/plugin-transform-modules-commonjs](https://npm.io/package/@babel/plugin-transform-modules-commonjs.md) ^7.26.3

## Recent versions

- 4.1.0 (latest) — 2026-10-12
- 3.1.3 (legacy-18) — 2026-07-23
- 4.0.0 — 2026-07-30
- 3.1.2 — 2026-05-02
- 3.1.1 — 2025-10-15
- 3.1.0 — 2025-07-10
- 3.0.0 — 2025-03-18
- 2.1.0 — 2024-05-21
- 2.0.0 — 2023-08-07
- 1.3.3 — 2023-05-26
- 1.3.2 — 2023-05-11
- 1.3.1 — 2023-04-14
- 1.3.0 — 2023-01-30
- 1.2.0 — 2022-12-16
- 1.1.0 — 2022-11-10
- … 4 more at https://npm.io/package/@google-cloud/typeless-sample-bot/versions

## README

# typeless-sample-bot

This bot will automatically convert sample snippets written in TypeScript into JavaScript
sample snippets. This lets you focus on writing TypeScript samples instead of having to
do only JavaScript, or having to maintain both.

## Installation

You will want to install this library as a globally-available, standalone binary.

`npm i @google-cloud/typeless-sample-bot -g`

## Usage

The bot can convert single files or an entire tree of files. In the latter case, it
will attempt to guess which files are actually snippets before doing anything with them.

For individual files, you can specify them as targets:

```bash
typeless-sample-bot --targets file1.ts,file2.ts,etc
```

The output will be written with the same filename stem, but a js extension.

You can also ask for recursive processing:

```bash
typeless-sample-bot --targets samples --recursive
```

Note that -t may be an array, still, for processing multiple recursive trees.

Various utility flags are also available:

```bash
# turn on verbose output
typeless-sample-bot --verbose

# turn on full debug output
typeless-sample-bot --debug

# turn off ANSI colour/emojis
typeless-sample-bot --no-art
```

### Options

| Option | Description | Default |
| ------ | ----------- | ------- |
| targets | List of target files or directory trees | *Required* |
| recursive | If set, targets will be directory trees processed recursively | False |
| verbose | If set, verbose output will be enabled | False |
| debug | If set, full debug output will be enabled | False |
| art | If set, ANSI colour and emojis will be used in the command output | True, use --no-art to cancel |

## Running tests:

`npm test`

## Contributing

If you have suggestions for how `typeless-sample-bot` could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

License: Apache 2.0

© 2022 Google LLC.

---
_Source: https://npm.io/package/@google-cloud/typeless-sample-bot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
