Documentation for Simbo's Packages
    Preparing search index...

    Module @simbo/call-prettier - v1.0.2

    Call Prettier

    📦 @simbo/call-prettier

    A lightweight utility for finding and invoking the Prettier binary on files, using the appropriate contextual settings of your project.

    It ensures that the correct Prettier instance is executed, whether installed locally or globally.

    • Locates the correct Prettier binary (local node_modules/.bin first, then global)

    • Calls Prettier in write or check mode

    • Supports custom working directories

    • Respects or ignores .prettierignore depending on options

    • Fully typed with TypeScript

    • Built on top of execa for reliable process execution

    Install @simbo/call-prettier from the npm registry:

    npm i [-D] @simbo/call-prettier
    

    For a complete API reference, see the documentation.

    import { callPrettier } from '@simbo/call-prettier';

    await callPrettier('src/**/*.ts', {
    mode: 'check', // defaults to 'write'
    workingDir: process.cwd(), // optional
    disableIgnores: false, // optional
    });

    MIT © Simon Lepel

    Interfaces

    Options

    Functions

    callPrettier