npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

typeorm-advanced-query-parser

v1.1.0

Published

Url query parser for typeorm

Readme

Typeorm-Query-Parser

Typeorm Query Parser is an advanced URL string parser for TypeORM that supports complex filtering, nested relations, and grouped conditions.

Installation

$ npm install typeorm-advanced-query-parser

Usage Example

import { QueryBuilder } from 'typeorm-advanced-query-parser';

const query = req.query;
const options = {};
const parser = new QueryBuilder(options);
const parsedQuery = parser.build(query);

EntityRepository.find(parsedQuery);

Features

  • Advanced filtering with AND/OR conditions
  • Nested field filtering
  • Grouped conditions
  • Support for all common comparison operators
  • Pagination and sorting
  • Relation joining
  • Query result caching

Documentation

Available Query Parameters

Select

Select specific fields from the database:

example.com?select=field1,field2

Sort

Sort results by multiple fields:

example.com?sort=field1,ASC;field2,DESC

Note: Defaults to ASC if order is not specified

Filter

Specify conditions for data filtering. Supports complex queries including nested fields, grouped conditions, and AND/OR operations.

Basic filtering:

example.com?filter=id||$eq||4

Nested field filtering:

example.com?filter=user#profile#city||$eq||NewYork

Grouped conditions:

example.com?filter=(name||$eq||John;age||$gt||25)

OR conditions:

example.com?filter=name||$eq||John||$or||age||$gt||25

Case-insensitive search (NEW in v1.1.0):

example.com?filter=name||$icont||john
# Matches: "John", "JOHN", "john", "JoHn"

Case-sensitive search:

example.com?filter=name||$cont||john
# Matches only: "john" (exact case)

Filter Operators

  • $eq - Equal (exact match)
  • $ne - Not equal
  • $cont - Contains (case-sensitive)
  • $icont - Contains (case-insensitive) ⭐ NEW in v1.1.0
  • $isnull - Is null
  • $gt - Greater than
  • $gte - Greater than or equal
  • $lt - Less than
  • $lte - Less than or equal
  • $starts - Starts with (case-sensitive)
  • $ends - Ends with (case-sensitive)
  • $in - In array
  • $between - Between values
  • ! - Negation prefix (can be used with any operator)

Limit

Limit the number of returned rows:

example.com?limit=10

Default: 25

Page

Enable pagination:

example.com?limit=25&page=2

Page numbers start from 1

Cache

Enable/disable query result caching:

example.com?cache=true

Default: false

Join

Include related entities:

example.com?join=relation1,relation2,relation3.nested

Configuration Options

You can customize the parser behavior by passing options to the QueryBuilder constructor:

const options = {
  LOOKUP_DELIMITER: '||',
  RELATION_DELIMITER: '.',
  CONDITION_DELIMITER: ';',
  VALUE_DELIMITER: ',',
  EXACT: '$eq',
  NOT: '!',
  CONTAINS: '$cont',
  ICONTAINS: '$icont', // Case-insensitive contains (v1.1.0+)
  IS_NULL: '$isnull',
  GT: '$gt',
  GTE: '$gte',
  LT: '$lt',
  LTE: '$lte',
  STARTS_WITH: '$starts',
  ENDS_WITH: '$ends',
  IN: '$in',
  BETWEEN: '$between',
  OR: '$or',
  DEFAULT_LIMIT: '25',
  GROUP_START: '(',
  GROUP_END: ')',
  AND: '$and',
  NESTED_DELIMITER: '#',
};

const parser = new QueryBuilder(options);

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT