# dprint-node

> A node API for the dprint TypeScript and JavaScript code formatter

Latest version **1.0.8** (published 2023-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install dprint-node
pnpm add dprint-node
yarn add dprint-node
bun add dprint-node
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2023-09-15 |
| First published | 2021-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 23.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 490 |
| Author | Devon Govett |
| Maintainers | devongovett |

## Links

- npm: https://www.npmjs.com/package/dprint-node
- Repository: https://github.com/devongovett/dprint-node
- Homepage: https://github.com/devongovett/dprint-node#readme
- Issues: https://github.com/devongovett/dprint-node/issues
- npm.io page: https://npm.io/package/dprint-node

## Dependencies (1)

- [detect-libc](https://npm.io/package/detect-libc.md) ^1.0.3

## Recent versions

- 1.0.8 (latest) — 2023-09-15
- 1.0.7 — 2022-08-25
- 1.0.6 — 2022-08-15
- 1.0.5 — 2021-12-23
- 1.0.4 — 2021-12-22
- 1.0.3 — 2021-12-20
- 1.0.2 — 2021-06-02
- 1.0.1 — 2021-06-02
- 1.0.0 — 2021-06-02

## README

# dprint-node

A node API for the [dprint](https://dprint.dev) TypeScript and JavaScript code formatter. It's written in Rust for blazing fast speed.

## Usage

Pass a file path and the code to format to `dprint.format`.

```js
const dprint = require('dprint-node');

dprint.format(filePath, code);
```

You can also optionally pass some configuration options as an object to the third parameter. All of the [options listed here](https://dprint.dev/plugins/typescript/config/) are supported.

```js
dprint.format(filePath, code, {
  lineWidth: 100
});
```

## Benchmark

```
$ node bench.js
#1 dprint: 12,173 opts/sec, ±17% (mean: 0.082ms, stddev: 0.051ms, 50 samples)
#2 prettier: 450 opts/sec, ±53% (mean: 2.222ms, stddev: 4.229ms, 50 samples)
```

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