Registry / devops / prettier_d_slim

prettier_d_slim

JSON →
library1.2.0jsnpmunverified

A daemon wrapper for Prettier that dramatically reduces formatting time by running a background server, eliminating Node.js startup and module loading overhead. Current stable version is 1.2.0, with infrequent releases. Compared to alternatives like prettier_d, prettier_d_slim is minimal and stable, with a smaller footprint. It automatically picks a free port, stores credentials in ~/.prettier_d_slim, and supports per-directory Prettier versions via a nanolru cache. Ideal for editor save-time formatting where sub-150ms latency is desired.

npm install prettier_d_slim
INSTALL
IMPORT
SIG · PRETTIER_D_SLIM
P
prettier_d_slim
devopsjavascriptv1.2.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (CLI)
✓ npx prettier_d_slim --stdin-filepath file.js < file.js
✗ prettier_d_slim file.js
prettier_d_slim is a CLI tool, not a library. It expects input via stdin or --text. File arguments alone may not work as expected.
start/stop/restart/status commands
✓ prettier_d_slim start
✗ prettier_d_slim --start
Commands are positional, not flags. Use 'prettier_d_slim start' not '--start'.
Programmatic usage (core_d)
✓ const core_d = require('core_d');
✗ import { core_d } from 'core_d';
core_d is a CommonJS library. ESM import may cause issues if your project is not configured for CJS interop. Use require() or a dynamic import.

Demonstrates installation, basic stdin formatting, server control commands, and netcat usage for sub-50ms formatting.

// Install globally $ npm install -g prettier_d_slim # Format a file via stdin (first time starts server, ~130ms) $ cat file.js | prettier_d_slim --stdin --stdin-filepath file.js # Format with text argument $ prettier_d_slim --stdin-filepath file.js --text 'const foo = {}' # Control server $ prettier_d_slim start $ prettier_d_slim status $ prettier_d_slim restart $ prettier_d_slim stop # Super fast with netcat (<50ms after server running) $ PORT=$(cat ~/.prettier_d_slim | cut -d" " -f1) $ TOKEN=$(cat ~/.prettier_d_slim | cut -d" " -f2) $ echo "$TOKEN $PWD file.js" | nc localhost $PORT
prettier_d_slim --version
Debug
Known issues
gotchaThe first invocation always starts the server and takes ~700ms. Subsequent calls are fast (~130ms).
fix
Run a warm-up call (e.g., format a dummy file) before performance-critical workflows.
affects: >=1.0.0
gotchaThe server binds to a random port and stores credentials in ~/.prettier_d_slim. Deleting this file breaks communication until server restart.
fix
Do not manually delete ~/.prettier_d_slim while server is running. Use 'prettier_d_slim stop' to cleanly shutdown.
affects: >=1.0.0
gotchaPer-directory Prettier versions are cached up to 10 entries. If you switch between many projects, older directories may lose their cached instance.
fix
The cache is LRU with size 10. To force a fresh instance for a directory, use 'prettier_d_slim restart' or remove the cache by stopping the server.
affects: >=1.0.0
gotchaWhen using stdin, the file path must be provided via --stdin-filepath, otherwise Prettier cannot infer the parser.
fix
Always use --stdin-filepath with a filename that matches the language (e.g., file.js, file.ts, file.css).
affects: >=1.0.0
Errors
Common errors & fixes
Error: No such file or directory (os error 2) open '~/.prettier_d_slim'
The server has not been started yet, or the credentials file was deleted.
fix
Run 'prettier_d_slim start' to start the server and create the file.
Error: listen EADDRINUSE :::<port>
The random port chosen by prettier_d_slim is already in use, or a previous server instance wasn't properly shut down.
fix
Run 'prettier_d_slim stop' to stop any existing server, then retry. If the port is occupied by another process, wait or manually kill the process.
stdin is not a TTY
The command expects stdin input but it was not piped or redirected.
fix
Redirect a file: 'prettier_d_slim --stdin --stdin-filepath file.js < file.js' or use --text.
prettier_d_slim: command not found
The package is not installed globally or not in PATH.
fix
Install globally with 'npm install -g prettier_d_slim' or use npx: 'npx prettier_d_slim ...'
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
prettieroptionalCore dependency: prettier_d_slim wraps Prettier and falls back to its own bundled version if not found locally.
core_drequiredLibrary that manages the background server lifecycle (start, stop, communication).
nanolrurequiredUsed internally to cache up to 10 Prettier instances by working directory.
Agent activity
6 hits · last 30 days
node
6
Resources
prettier_d_slim — npm install prettier_d_slim · libregistry