npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

razzaq-pretty

v1.1.0

Published

An uncompromising, AST-based code formatter, forged by Prometheus Prime.

Readme

Razzaq Pretty ✨

npm version Build Status License: MIT

An uncompromising, AST-based code formatter designed for superior consistency and extensibility.

Razzaq Pretty bukan sekadar pemformat kode. Ini adalah enforcer standar yang memastikan setiap baris kode di seluruh proyek Anda mematuhi doktrin kejelasan dan presisi yang absolut. Dibangun di atas Abstract Syntax Tree (AST), ia memahami kode Anda pada tingkat struktural, memungkinkan manipulasi yang cerdas dan aman yang tidak mungkin dicapai oleh alat berbasis regex.

Fitur Unggulan

  • Mesin Berbasis AST: Memanipulasi kode dengan pemahaman sintaksis penuh, bukan sekadar teks.
  • Performa Superior: Menggunakan worker threads untuk pemrosesan paralel dan cache berbasis hash cerdas untuk hanya memformat file yang berubah.
  • Sangat Dapat Dikonfigurasi: Kontrol setiap aspek pemformatan, mulai dari indentasi hingga plugin kustom, melalui file .razzaqrc yang sederhana.
  • Sistem Plugin: Perluas fungsionalitas inti dengan plugin bawaan untuk aturan yang lebih kompleks, seperti melarang console.log atau mengelola baris kosong secara cerdas.
  • Inisialisasi Otomatis: Hasilkan file konfigurasi yang sempurna secara otomatis, menghilangkan kemungkinan human error.

Instalasi

Untuk Penggunaan CLI

Instalasi paket secara global untuk mengakses perintah razzaq-pretty dari mana saja.

npm install -g razzaq-pretty

Untuk Penggunaan Pustaka (Programmatic)

Tambahkan sebagai dependensi ke proyek Anda.

npm install razzaq-pretty

Penggunaan

1. Command-Line Interface (CLI)

Setelah instalasi global, Anda dapat langsung menggunakannya.

Langkah 1: Inisialisasi (Satu Kali per Proyek) Navigasi ke root direktori proyek Anda dan jalankan:

razzaq-pretty --init

Perintah ini akan membuat file .razzaqrc dengan konfigurasi default yang disarankan.

Langkah 2: Eksekusi Jalankan pemformat pada file atau direktori target Anda.

# Lakukan dry-run (periksa file yang akan diubah tanpa menyimpannya)
razzaq-pretty "src/**/*.js"

# Tulis perubahan ke file
razzaq-pretty --write "src/**/*.js"

# Paksa pemformatan ulang semua file (abaikan cache)
razzaq-pretty --write --no-cache "src/**/*.js"

2. Pustaka (Programmatic)

Impor dan gunakan fungsi formatCode di dalam proyek Node.js Anda.

import { formatCode } from 'razzaq-pretty';

const sourceCode = 'const x = 1;;';

async function run() {
  const formattedCode = await formatCode(sourceCode, {
    semi: true,
    lineWidth: 80,
  });
  console.log(formattedCode);
}

run();

Konfigurasi (.razzaqrc)

Atur perilaku pemformat melalui file .razzaqrc di root proyek Anda. Gunakan razzaq-pretty --init untuk menghasilkan file ini secara otomatis.

Berikut adalah contoh konfigurasi lengkap:

{
  "indent": 2,
  "quote": "'",
  "lineWidth": 100,
  "semi": true,
  "watermark": true,
  "stripComments": false,
  "workers": 4,
  "plugins": [
    "removeExtraBlankLines",
    "disallowConsoleLog"
  ]
}

| Kunci | Tipe | Deskripsi | | ----------------- | --------- | ------------------------------------------------------------------------- | | indent | Number | Jumlah spasi per indentasi. | | quote | String | Jenis kutip yang digunakan (' atau "). | | lineWidth | Number | Panjang baris maksimum. | | semi | Boolean | true untuk menambahkan titik koma. | | watermark | Boolean | true untuk menambahkan watermark Formatted by Razzaq-Formatter. | | stripComments | Boolean | true untuk menghapus semua komentar. | | workers | Number | Jumlah thread paralel yang akan digunakan. | | plugins | Array | Daftar plugin AST bawaan yang akan diaktifkan. |

Lisensi

Didistribusikan di bawah Lisensi MIT. Lihat LICENSE untuk informasi lebih lanjut.