Parser for SCIM Filter Query Strings
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.eslintrc write parser and tests Dec 14, 2016
.gitignore Initial commit Dec 14, 2016
.travis.yml add travis Dec 15, 2016
LICENSE Initial commit Dec 14, 2016 update readme Dec 15, 2016
index.js add filter.test Dec 15, 2016
package.json 1.1.0 Dec 15, 2016
test.js add filter.test Dec 15, 2016

Build Status


    const Filter = require('scim-query-filter-parser');

    const filter = new Filter('userName eq "somebody123"');

    // get the parsed filter as an RPN stack
    const rpn = filter.rpn;

    // get the parsed filter as an expression tree
    const tree = filter.tree;

    // get the parsed filter as an expression tree
    const results = [
        {userName: 'somebody123'},
        {userName: 'somebody456'}


This implements a parser for the filtering syntax defined in System for Cross-Domain Identity Management (SCIM) Protocol 1.1. It is originally a port of scim-query-filter-parser-rb and was built for use by AuthX;

This package can parse one of these filter queries and produce a Reverse Polish Notation (RPN) stack or expression tree.

It can also be used to test resources against the parsed filter query.

For example, parse this filter query string:

userType eq "Employee" and (emails co "" or emails co "")

Into this RPN stack (array):

['userType', '"Employee"', 'eq', 'emails', '""', 'co', 'emails', '""', 'co', 'or', 'and']

Or, optionally into this expression tree:


Methods & Properties

new Filter(filterQueryString, [preserveCase=false])

Parse a SCIM filter query and return a Filter object.


Get the RPN array created by the most recent parse.


Get the parse result converted to a tree form.


Tests a resource against a filter. This method is already bound to the filter, so that it can easily be used as an argument for Array.prototype.filter and similar methods.