{"library":"odata-v4-parser","title":"OData v4 Parser","description":"The `odata-v4-parser` package provides a JavaScript parser for OData v4 URI query strings, converting them into an Abstract Syntax Tree (AST). This allows developers to programmatically interpret and act upon OData query parameters like `$filter`, `$orderby`, `$top`, and `$skip`. The package's current specified version, 0.1.29, reflects its last update several years ago, making it an effectively abandoned project. It was primarily designed for CommonJS environments and does not actively support modern JavaScript features or evolving OData specifications. While it ships with TypeScript type definitions, its long-term maintenance status and compatibility with contemporary Node.js versions are highly questionable. It differentiates itself by offering a direct parsing utility for OData v4 queries, but its lack of updates means it may not support all features of the OData v4 standard or address potential security concerns inherent in parsing external input.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install odata-v4-parser"],"cli":null},"imports":["const parser = require('odata-v4-parser');","const parser = require('odata-v4-parser');\nconst ast = parser.parse('$filter=...');","const parser = require('odata-v4-parser');\nconst filterAst = parser.filter('Title eq \\'Article1\\'');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const parser = require('odata-v4-parser');\n\n// Example 1: Parsing a simple $filter expression\nconst filterQuery = \"$filter=Name eq 'John Doe' and Age gt 30\";\ntry {\n  const filterAst = parser.filter(filterQuery);\n  console.log('Parsed Filter AST:', JSON.stringify(filterAst, null, 2));\n} catch (e) {\n  console.error(`Error parsing filter '${filterQuery}':`, e.message);\n}\n\n// Example 2: Parsing a full OData URI (assuming a 'parse' method is available)\nconst fullODataQuery = \"$filter=Category/Name eq 'Books'&$orderby=Price desc&$top=5&$skip=10\";\ntry {\n  const fullAst = parser.parse(fullODataQuery);\n  console.log('Parsed Full Query AST:', JSON.stringify(fullAst, null, 2));\n} catch (e) {\n  console.error(`Error parsing full query '${fullODataQuery}':`, e.message);\n  console.log(\"Note: If 'parser.parse' is not available, you might need to parse sections individually.\");\n}\n\nconsole.log(\"\\nNote: The output AST structure depends on the internal implementation of this specific parser version.\");","lang":"javascript","description":"Demonstrates parsing OData $filter expressions and full OData URI query strings into an Abstract Syntax Tree (AST).","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}