The `raml-1-parser` is a JavaScript and TypeScript parser library designed for RAML (RESTful API Modeling Language) specifications, offering support for both RAML 0.8 and 1.0 versions. It facilitates the parsing of RAML files from various sources (filesystem paths or URLs) into a structured JSON representation of the API definition, which is useful for API introspection, documentation generation, and tooling development. The current stable version is 1.1.67, with its last significant feature update, including circular reference support, occurring in v1.1.52. This package maintains a slow release cadence, primarily for dependency and security updates. A critical detail for users is that this parser is officially deprecated by the RAML organization. While it once provided comprehensive RAML 1.0 support, its current status means it no longer receives active feature development or consistent security patching. Users are strongly advised to migrate to `@raml-org/webapi-parser` for ongoing maintenance and support.
npm install raml-1-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to asynchronously load and parse a RAML 1.0 API definition from a local file, then serialize its parsed JSON representation.
Migrate your parsing logic to `@raml-org/webapi-parser`. Consult its documentation for migration guides and API differences.
Upgrade your Node.js runtime to version 6 or higher. The package specifies `"node": ">=6"` in its `engines` field.
Ensure you are using the latest available version (1.1.67) of `raml-1-parser`. For ongoing security maintenance, migrating to `@raml-org/webapi-parser` is crucial.
Always use `await` with `load` or `parse`, or chain `.then()` and `.catch()` callbacks to handle the Promise. For explicitly synchronous parsing, use `raml.loadRAMLSync(path)` or `raml.parseRAMLSync(content)`.
For CommonJS, use `const raml = require('raml-1-parser'); raml.load(...)` or `const { load } = require('raml-1-parser');`. For TypeScript/ESM, ensure `import { load } from 'raml-1-parser';` is used and your `tsconfig.json` includes `"esModuleInterop": true` if importing CommonJS modules with ES module syntax.Run `npm install raml-1-parser` in your project's root directory.
For CommonJS files, use `const { load } = require('raml-1-parser');` or `const raml = require('raml-1-parser'); raml.load(...)`. If you intend to use ES Modules, ensure your `package.json` contains `"type": "module"` or use a `.mjs` file extension and appropriate import paths.Carefully review your RAML file against the RAML 1.0 specification. Use a RAML-aware editor (like API Workbench, if still supported) for real-time validation. The error message should provide details on the specific validation failures.
No dependency data recorded yet.