FIQL Parser
raw JSON →The `fiql-parser` library by `vmoebius` provides a foundational parser for FIQL (Feed Item Query Language) expressions within Node.js environments. FIQL is a URI-friendly syntax primarily designed for filtering entries in syndicated feeds, and it serves as the basis for the more comprehensive RSQL (RESTful Service Query Language) commonly employed in RESTful API query parameters. Currently at version `0.1.5`, this package saw its most recent publish around late 2025/early 2026. Its low version number suggests a lightweight or early-stage development focus, offering a direct implementation of the FIQL grammar for JavaScript applications. While a formal release cadence is not established, the recent publishing activity indicates a minimal level of ongoing attention or re-publishing, differentiating it as a dedicated FIQL parsing utility.
Common errors
error TypeError: parser.parse is not a function ↓
require syntax: const parser = require('fiql-parser'); or, if using ESM with bundler support, import parser from 'fiql-parser'; (though CJS is the primary documented method). error SyntaxError: Expected "==" or "!=" or "=lt=" or "=" or ">=" or ">" or "<=" or "<" but "@" found. ↓
error ERR_REQUIRE_ESM: Must use import to load ES Module: .../node_modules/fiql-parser/index.js ↓
import('fiql-parser') or consider an alternative parser with native ESM support. For older Node.js versions or strict ESM, sticking to CJS for this package is safest: const parser = require('fiql-parser');. Warnings
gotcha The package is at a low major version (0.1.5), indicating that the API might not be fully stable and could introduce breaking changes in minor versions, or may lack advanced features found in more mature RSQL/FIQL parsers. ↓
gotcha This library is primarily designed for CommonJS (`require`) environments. While modern bundlers might polyfill or adapt, direct ESM (`import`) usage is not explicitly documented or guaranteed to work without configuration or wrapper code. ↓
gotcha Being a parser, the library will throw errors for malformed FIQL query strings. Robust applications must implement comprehensive error handling around `parser.parse()` calls. ↓
Install
npm install fiql-parser yarn add fiql-parser pnpm add fiql-parser Imports
- parser wrong
import { parser } from 'fiql-parser';correctimport parser from 'fiql-parser'; - parser
const parser = require('fiql-parser'); - Parser wrong
import { Parser } from 'fiql-parser';correct/* The package exports a direct parser function, not a class or named export. */
Quickstart
const parser = require('fiql-parser');
const fiqlQuery = 'title==foo*;(updated=lt=-P1D,author==*bar*)';
try {
const ast = parser.parse(fiqlQuery);
console.log('Successfully parsed FIQL query:');
// In a real application, you would now traverse the AST
// For example, convert it to SQL, MongoDB query, or filter an array.
console.log(JSON.stringify(ast, null, 2));
const anotherQuery = 'price=gt=100;category==electronics';
const anotherAst = parser.parse(anotherQuery);
console.log('\nSuccessfully parsed another query:');
console.log(JSON.stringify(anotherAst, null, 2));
} catch (error) {
console.error('Error parsing FIQL query:', error.message);
console.error(error);
}