{"id":16034,"library":"fork-raml-1-parser","title":"RAML 1.0 JavaScript Parser","description":"The `fork-raml-1-parser` package is a JavaScript parser for RAML 0.8 and 1.0 API specifications. It reached its end-of-life and is officially deprecated as of its latest stable version, 1.1.68. Development on this package has ceased, with the recommendation to migrate to `@raml-org/webapi-parser` for ongoing support, security updates, and new features. While it ships with TypeScript types, providing better integration in typed environments, its primary quickstart examples and usage patterns often leverage CommonJS `require` syntax. Its release cadence was irregular towards its deprecation, primarily focusing on critical dependency and security fixes rather than new RAML specification features. A key differentiator was its ability to directly interpret RAML specification structures and produce a high-level Abstract Syntax Tree (AST), unlike generic YAML/JSON parsers.","status":"deprecated","version":"1.1.68","language":"javascript","source_language":"en","source_url":"https://github.com/raml-org/raml-js-parser-2","tags":["javascript","raml","js","raml-parser","parser","typescript"],"install":[{"cmd":"npm install fork-raml-1-parser","lang":"bash","label":"npm"},{"cmd":"yarn add fork-raml-1-parser","lang":"bash","label":"yarn"},{"cmd":"pnpm add fork-raml-1-parser","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"For TypeScript and modern ESM, use named import for the CommonJS default export. The 'raml' symbol represents the main parser API.","wrong":"import raml from 'raml-1-parser';","symbol":"raml","correct":"import * as raml from 'raml-1-parser';"},{"note":"This is the primary and most common import pattern shown in documentation and quickstarts for Node.js CommonJS environments.","symbol":"raml","correct":"const raml = require('raml-1-parser');"},{"note":"This package is deprecated. For new projects or migration, use `@raml-org/webapi-parser` instead. Import paths and API will differ significantly.","symbol":"webapi-parser","correct":"import { RamlParser } from '@raml-org/webapi-parser';"}],"quickstart":{"code":"const raml = require(\"raml-1-parser\");\nconst fs = require('fs');\nconst path = require('path');\n\n// Create a dummy RAML file for the example\nconst ramlFileName = path.join(__dirname, 'my-api.raml');\nconst ramlContent = `#%RAML 1.0\\ntitle: My Example API\\nversion: v1\\nbaseUri: https://api.example.com`;\nfs.writeFileSync(ramlFileName, ramlContent);\n\nconsole.log(`Parsing RAML file: ${ramlFileName}`);\n\ntry {\n  // The 'load' method can often work synchronously for local files.\n  const apiJSON = raml.load(ramlFileName);\n  console.log(\"Parsed RAML API JSON:\");\n  console.log(JSON.stringify(apiJSON, null, 2));\n} catch (error) {\n  console.error(\"Error parsing RAML file:\", error);\n}\n\n// Clean up the dummy file\nfs.unlinkSync(ramlFileName);","lang":"javascript","description":"Demonstrates how to synchronously load and parse a local RAML 1.0 file using the `raml-1-parser` library."},"warnings":[{"fix":"Migrate your parsing logic to use `@raml-org/webapi-parser`. This will involve significant code changes as the API surface is different.","message":"This package is officially deprecated. The RAML organization recommends migrating to `@raml-org/webapi-parser` for all new development and ongoing maintenance. No further feature development or active support is expected for `raml-1-parser`.","severity":"breaking","affected_versions":">=1.1.68"},{"fix":"Upgrade your Node.js runtime to version 6 or higher. The parser officially supports Node.js 6, 8, 11, and later versions since 1.1.51.","message":"Node.js 4 support was dropped with version 1.1.51. Users on older Node.js runtimes will experience errors or require specific older versions of the parser.","severity":"breaking","affected_versions":">=1.1.51"},{"fix":"Ensure you are using `raml-1-parser` version 1.1.59 or newer. Alternatively, migrate to the officially supported `@raml-org/webapi-parser`.","message":"Versions prior to 1.1.59 had a security vulnerability related to the `serialize-javascript` dependency. While fixed in later `raml-1-parser` versions, older deployments might be at risk.","severity":"gotcha","affected_versions":"<1.1.59"},{"fix":"Do not install or use `raml-1-parser@1.1.54`. Pin your dependency to a working version like 1.1.53 or 1.1.55+.","message":"Version 1.1.54 was a broken npm release and should be avoided. Installing or deploying this specific version will likely lead to operational failures.","severity":"gotcha","affected_versions":"=1.1.54"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Ensure the package is installed using `npm install raml-1-parser` or `yarn add raml-1-parser`. For new projects, consider installing and using `@raml-org/webapi-parser` instead.","cause":"The package was not installed, or there's a path resolution issue in your environment.","error":"Error: Cannot find module 'raml-1-parser'"},{"fix":"Verify your import statement: `const raml = require('raml-1-parser');` for CommonJS or `import * as raml from 'raml-1-parser';` for ESM/TypeScript. Ensure you are using a consistent and reasonably recent version (e.g., >=1.1.50 if not migrating).","cause":"Incorrect import of the `raml` object, or an outdated version of the package where the `load` method might be structured differently.","error":"TypeError: raml.load is not a function"},{"fix":"Upgrade your Node.js runtime to version 6 or higher. `raml-1-parser@1.1.51` and later explicitly require Node.js >=6.","cause":"Using a `raml-1-parser` version that dropped support for Node.js 4.x on an unsupported Node.js runtime.","error":"Node 4.x or older compatibility errors (e.g., syntax errors with ES6 features)"}],"ecosystem":"npm"}