# simple-code-frame

> A tiny utility to create code frames

Latest version **1.3.0** (published 2023-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-code-frame
pnpm add simple-code-frame
yarn add simple-code-frame
bun add simple-code-frame
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2023-01-25 |
| First published | 2020-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 19.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Marvin Hagemeister |
| Maintainers | marvinhagemeister |

## Links

- npm: https://www.npmjs.com/package/simple-code-frame
- Repository: https://github.com/marvinhagemeister/simple-code-frame
- Homepage: https://github.com/marvinhagemeister/simple-code-frame#readme
- Issues: https://github.com/marvinhagemeister/simple-code-frame/issues
- npm.io page: https://npm.io/package/simple-code-frame

## Dependencies (1)

- [kolorist](https://npm.io/package/kolorist.md) ^1.6.0

## Recent versions

- 1.3.0 (latest) — 2023-01-25
- 1.2.0 — 2021-09-05
- 1.1.1 — 2021-04-01
- 1.1.0 — 2021-04-01
- 1.0.0 — 2020-07-04

## README

# simple-code-frame

Tiny library for displaying code frames. The main difference to `@babel/code-frame` is that this library doesn't ship with a parser. It is soley aimed at taking text input and adding column + line markers.

## Usage

```bash
npm install simple-code-frame
# or via yarn
yarn add simple-code-frame
```

Usage

```js
import { createCodeFrame } from 'simple-code-frame';

const str = `foo\nbar\nbob`;

const codeFrame = createCodeFrame(str, 1, 2);
console.log(codeFrame);
// Logs:
//   1 | foo
// > 2 | bar
//     |  ^
//   3 | bob
```

### License

`MIT`, see [the license file](./LICENSE).

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