Registry / serialization / format-parser

format-parser

JSON →
library0.0.2jsnpmunverified

format-parser is a JavaScript utility designed for parsing declarative format strings, primarily intended for use with template engines. It allows for the definition of data transformations and formatting within a string, such as `created_at | date:"%Y %M %d"`. The package's current and only version, `0.0.2`, was last published in December 2012. It emerged from the now-obsolete `component(1)` build ecosystem, a client-side package manager that predates modern npm and browser module bundlers. Due to its age and lack of updates, it is considered abandoned. This makes it unsuitable for modern development, as it lacks support for ES Modules, TypeScript, and has not received security patches or performance improvements in over a decade. Modern alternatives provide more robust, actively maintained, and feature-rich parsing capabilities for various data formats.

npm install format-parser
INSTALL
IMPORT
SIG · FORMAT-PARSER
F
format-parser
serializationjavascriptv0.0.2
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.

parse
const parse = require('format-parser');
import parse from 'format-parser'; import { parse } from 'format-parser';
This package is CommonJS-only and does not support ES Modules. It was developed for the `component(1)` ecosystem, which predates widespread ESM adoption.

Demonstrates how to import and use the `parse` function to process various declarative format strings, showing the resulting AST-like structure and potential error handling.

const parse = require('format-parser'); console.log('Parsing "created_at | date:\"%Y %M %d\"":'); try { const result1 = parse('created_at | date:"%Y %M %d"'); console.log('Result 1 (AST-like structure):', JSON.stringify(result1, null, 2)); console.log('\nParsing "item.price | currency:\"USD\"":'); const result2 = parse('item.price | currency:"USD"'); console.log('Result 2 (AST-like structure):', JSON.stringify(result2, null, 2)); console.log('\nParsing a more complex string: "user.name | uppercase | truncate:10"'); const result3 = parse('user.name | uppercase | truncate:10'); console.log('Result 3 (AST-like structure):', JSON.stringify(result3, null, 2)); // Demonstrate an invalid format to observe error handling (if any) console.log('\nAttempting to parse an invalid string: "bad_format | missing_arg:"'); try { const result4 = parse('bad_format | missing_arg:'); console.log('Result 4 (might be incomplete/erroneous AST):', JSON.stringify(result4, null, 2)); } catch (e) { console.error('Error parsing invalid string (expected for bad syntax):', e.message); } } catch (e) { console.error('An unexpected runtime error occurred:', e.message); console.error('This package is very old; ensure compatibility with your Node.js version and environment.'); }
Debug
Known issues
breakingThe `format-parser` package is abandoned and has not been maintained for over a decade. It will not receive bug fixes, performance improvements, or security updates.
fix
Do not use in new projects. For existing usage, migrate to a modern, actively maintained parsing library or implement custom parsing logic that fits current JavaScript standards and practices.
affects: >=0.0.2
gotchaThis package relies on the obsolete `component(1)` build ecosystem. While it is available on npm, its architecture is not designed for modern JavaScript build tools (e.g., Webpack, Rollup, Vite) or module resolution.
fix
Direct npm installation might function in some CommonJS environments, but integration with modern bundlers may be challenging and require specific, non-standard configurations. It is strongly recommended to use alternatives designed for the contemporary JavaScript ecosystem.
affects: >=0.0.2
gotchaThe package is CommonJS-only and lacks native support for ES Modules (ESM).
fix
Only `require()` syntax is supported. If attempting to use in an ESM project, a CJS wrapper or dynamic `import()` might be technically possible but is not recommended due to the package's overall abandonment and potential for further compatibility issues.
affects: >=0.0.2
gotchaNo TypeScript type definitions (`.d.ts` files) are provided for this package.
fix
For TypeScript projects, manual type declarations would be required, adding overhead. Considering the package's abandoned status, investing time in type definitions is not advisable; prefer a type-safe modern alternative.
affects: >=0.0.2
gotchaAs an unmaintained library, `format-parser` is susceptible to undiscovered security vulnerabilities, including supply chain risks, which will not be addressed.
fix
Using this package in production environments introduces significant security risks. Conduct a thorough security audit if absolutely necessary, but prioritize migrating to a well-maintained and audited solution.
affects: >=0.0.2
Errors
Common errors & fixes
TypeError: parse is not a function
Attempting to use ES Module `import` syntax (`import parse from 'format-parser';` or `import { parse } from 'format-parser';`) with this CommonJS-only package.
fix
Ensure you are using CommonJS `require()` syntax: `const parse = require('format-parser');`
Error: Cannot find module 'format-parser'
Module resolution failure in a modern environment or bundler that expects ES Modules or has specific configurations for handling CommonJS modules. This can be exacerbated by the package's age and its origins in the `component(1)` ecosystem.
fix
Verify that your bundler (e.g., Webpack, Rollup, Parcel) is correctly configured to process and include CommonJS modules from `node_modules`. If the issue persists, the fundamental incompatibility with modern toolchains suggests migrating to a different solution.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
format-parser — npm install format-parser · libregistry