Registry / serialization / yamlparser

yamlparser

JSON →
library0.2.3jsnpmunverified

The `yamlparser` package is an extremely old and unmaintained JavaScript YAML parser, last published in May 2013 with its only version being 0.0.2. It was created as a CommonJS port of an earlier client-side JavaScript YAML parser and aims to handle 'simply structured YAML files' rather than fully implementing the YAML specification. The package's GitHub repository was archived in December 2022, officially marking it as read-only and abandoned. Due to its age, lack of updates, and limited feature set, it is not suitable for modern applications. Users requiring YAML parsing functionality should consider actively maintained alternatives like `js-yaml` or `yaml` that support current YAML specifications and modern JavaScript environments (ESM).

npm install yamlparser
INSTALL
IMPORT
SIG · YAMLPARSER
Y
yamlparser
serializationjavascriptv0.2.3
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.

parse
✓ const yamlparser = require('yamlparser'); const parsed = yamlparser.parse(yamlString);
✗ import { parse } from 'yamlparser';
This package is strictly CommonJS. There is no official documentation for its API, but a `parse` method is inferred as the primary interface for parsing YAML strings. ESM imports are not supported.

Demonstrates how to import the `yamlparser` module using CommonJS `require` and parse a simple YAML string. Note the lack of error handling guarantees for malformed YAML due to limited spec support and undocumented API.

const yamlparser = require('yamlparser'); const yamlString = ` name: John Doe age: 30 cities: - New York - London active: true `; try { const data = yamlparser.parse(yamlString); console.log('Parsed YAML:', data); // Expected output: { name: 'John Doe', age: 30, cities: [ 'New York', 'London' ], active: true } } catch (error) { console.error('Failed to parse YAML:', error.message); } // Example with invalid YAML (may throw an error or produce unexpected results depending on implementation) const invalidYamlString = ` key: value another_key: indented_incorrectly `; try { const invalidData = yamlparser.parse(invalidYamlString); console.log('Parsed invalid YAML:', invalidData); } catch (error) { console.error('Failed to parse invalid YAML as expected:', error.message); }
Debug
Known issues
breakingThe `yamlparser` package is entirely abandoned. Its GitHub repository was archived in December 2022, and it has not been updated since its initial release in 2013. Using this package introduces significant security vulnerabilities due to unpatched issues and lack of maintenance.
fix
Migrate to a currently maintained YAML parser like `js-yaml` or `yaml`.
affects: >=0.0.1
gotchaThis package is strictly CommonJS (CJS) and does not support ES Modules (ESM). Attempting to import it using `import` statements in an ESM project will result in a runtime error.
fix
If stuck in a CJS environment, use `const yamlparser = require('yamlparser');`. For new projects, prefer modern parsers with ESM support.
affects: >=0.0.1
gotchaThe package documentation is explicitly marked as 'ToDo' on npm, meaning there is no official API documentation. The exact methods and their behavior (e.g., `parse`, `load`, error handling) are not specified and must be inferred or found through source code analysis.
fix
Due to the undocumented API and abandoned status, it is strongly recommended not to use this package. If forced to use it, thorough testing of its behavior for all expected YAML inputs is necessary.
affects: >=0.0.1
gotchaThe package explicitly states it 'does not intend to implement all the aspects formalized in the YAML specs,' focusing only on 'simply structured YAML files.' Complex YAML features (e.g., anchors, tags, specific data types) may not be supported or may be parsed incorrectly.
fix
Avoid using this parser for any YAML that utilizes advanced features. For full YAML specification compliance, use modern, actively maintained libraries.
affects: >=0.0.1
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported. Instead change the require of ... to a dynamic import() call.
Attempting to `require()` an ES Module or using `import` to load this CommonJS package in an ES Module context.
fix
This package is CommonJS-only. Ensure your project is configured for CommonJS or use a dynamic `import()` if bridging CJS and ESM. However, the fundamental fix is to migrate to a modern YAML parser that supports ESM.
TypeError: yamlparser.parse is not a function
The specific API for `yamlparser` is not officially documented. While `parse` is a common method for parsers, the module might export its parsing functionality differently (e.g., directly as a function `require('yamlparser')(yamlString)` or with a different method name).
fix
Due to the lack of documentation, you would typically need to inspect the source code to determine the correct function to call. However, the recommended fix is to switch to a well-documented and maintained YAML parsing library.
Upgrade
Version history
0.2.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
35 hits · last 30 days
node
28
Bingbot
1
OpenAI (training)
1
Resources
yamlparser — npm install yamlparser · libregistry