New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

prettier-core-printer

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-core-printer

This package extracts the just necessary files from prettier [GitHub repo](https://github.com/prettier/prettier/tree/main/src) to enable printing. It doesn't include parser or other components from prettier.

  • 3.4.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Overview

This package extracts the just necessary files from prettier GitHub repo to enable printing. It doesn't include parser or other components from prettier.

Here is a simple example of how this repo could be used (from test/dev/devTest.js)

import {group, indent, line} from '../../dist/document/builders.js';
import {printDocToString} from '../../dist/document/printer.js';

function testPrinter() {
  console.log(
    printDocToString(group(['(*', indent([line, 'Prettier:', line, 'Opinionated,', line, 'Code,', line, 'Formatter']), line, '*)']), {printWidth: 80})
      .formatted
  );
}

testPrinter();

Why?

We wanted to build a formatter Sfsql language (superset of Salesforce SOQL/SOSL language), and we wanted something to be able to generate the formatted source. We have our own parser and so didn't want to include a full prettier package which adds around 5+mb to the package. So we extracted just the files needed to print the Doc tokens.

Use Cases

You can use it for anything you like as long you can create Doc tokens for your text, you can build a printer.

License

It uses the same license as Prettier, which is MIT. All copyrights belong to the prettier repo.

FAQs

Package last updated on 24 Aug 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc