Registry / devops / prettier-standalone

prettier-standalone

JSON →
library1.3.1-0jsnpmunverified

Standalone browser build of Prettier, an opinionated code formatter. Version 1.3.1-0 (archived, replaced by prettier's built-in standalone bundles). This package is a legacy wrapper that allowed using Prettier in browser environments before Prettier officially shipped standalone UMD/ESM builds. It aggregates all Prettier language parsers into a single browser-compatible bundle. The official Prettier package now includes its own standalone builds (e.g., 'standalone.js', 'parser-*.js') in the 'prettier' npm package, making this package obsolete. No longer maintained; users should switch to the official 'prettier' package and its standalone modules.

npm install prettier-standalone
INSTALL
IMPORT
SIG · PRETTIER-STANDALON
P
prettier-standalone
devopsjavascriptv1.3.1-0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

prettier
import prettier from 'prettier/standalone'
import prettier from 'prettier-standalone'
The official Prettier provides standalone builds under 'prettier/standalone'. This package is obsolete.
format
const result = await prettier.format(code, { parser: 'babel' })
const result = prettier.format(code, { parser: 'babylon' })
Parser names changed in later Prettier versions; use current Prettier documentation.
check
const isFormatted = await prettier.check(code, { parser: 'babel' })
prettier.checkSync(code, { parser: 'babel' })
prettier.check is async in standalone builds.

Demonstrates using official prettier standalone in browser with ES module imports from CDN.

// Install: npm install prettier // Use in browser via script tag (ES modules): import prettier from 'https://unpkg.com/prettier@2.8.8/standalone.mjs'; import parserBabel from 'https://unpkg.com/prettier@2.8.8/parser-babel.mjs'; const code = 'const x = 1'; prettier.format(code, { parser: 'babel', plugins: [parserBabel] }).then(result => console.log(result)); // Output: "const x = 1;"
Debug
Known issues
deprecatedprettier-standalone is deprecated; use official prettier package standalone builds.
fix
Replace import 'prettier-standalone' with 'prettier/standalone' and install 'prettier' instead.
affects: >=0.0.0
breakingVersion 1.x is extremely outdated and incompatible with modern Prettier APIs and parsers.
fix
Migrate to prettier@latest and use the official standalone builds.
affects: 1.x
gotchaThis package bundles all parsers in one file; official standalone requires explicit parser imports.
fix
With official Prettier, import and register parsers via 'plugins' option.
affects: >=0.0.0
deprecatedPackage has not been updated since Prettier 1.3.1 and may have security vulnerabilities.
fix
Switch to actively maintained 'prettier' package.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'prettier-standalone'
The package is obsoleted and not installed; users often mistakenly install the wrong package.
fix
Install 'prettier' instead: npm install prettier
prettier.format is not a function
Using CommonJS require of 'prettier-standalone' in browser without bundler.
fix
Use ES module import from official standalone: import prettier from 'prettier/standalone'
Uncaught TypeError: Cannot read properties of undefined (reading 'parsers')
In official standalone, parsers must be passed as plugins; this package's monolithic bundle made them global.
fix
Import parser modules and pass them in the plugins array: plugins: [parserBabel]
Upgrade
Version history
1.3.1-0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
prettier-standalone — npm install prettier-standalone · libregistry