Socket
Socket
Sign inDemoInstall

stainless-dprint-node

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stainless-dprint-node

A node API for the dprint TypeScript and JavaScript code formatter


Version published
Maintainers
1
Install size
7.02 MB
Created

Readme

Source

dprint-node

A node API for the dprint 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.

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 are supported.

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)

FAQs

Last updated on 25 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc