# qiitable

> Parse Qiita-like search queries

Latest version **2.0.0** (published 2020-12-07) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install qiitable
pnpm add qiitable
yarn add qiitable
bun add qiitable
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2020-12-07 |
| First published | 2020-12-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12 |
| Dependencies | 1 |
| Unpacked size | 21 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | ryamaguchi0220 |
| Maintainers | ryamaguchi0220 |
| Keywords | qiita, github, search, filter, query, parser |

## Links

- npm: https://www.npmjs.com/package/qiitable
- Repository: https://github.com/ryamaguchi0220/qiitable
- Homepage: https://github.com/ryamaguchi0220/qiitable#readme
- Issues: https://github.com/ryamaguchi0220/qiitable/issues
- npm.io page: https://npm.io/package/qiitable

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^3.10.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2020-12-07
- 1.0.0 — 2020-12-04

## README

# Qiitable

[![Build Status](https://travis-ci.com/ryamaguchi0220/qiitable.svg?branch=master)](https://travis-ci.com/ryamaguchi0220/qiitable)
[![NPM version](https://badge.fury.io/js/qiitable.svg)](https://badge.fury.io/js/qiitable)

Qiitable is a Node.JS module to parse [Qiita-like search queries](https://help.qiita.com/ja/articles/qiita-search-options).

This module is perfect for integrating complex search (like Qiita search) into your application.

### Queries

| Type | Example |
| ---- | ------- |
| Query for tags | `Ruby` |
| Query for multiple tags | `Ruby Rails`, `"Ruby on Rails"` |
| Query for equality | `user:sampleuser`, `user:"sample user"` |
| Query for not-equality | `-user:sampleuser` |
| Query for values greater than another value | `stocks:>10`, `stocks:>=10` |
| Query for values less than another value | `stocks:<100`, `stocks:<=100` |

### How to use it?

Install it using:

```
$ npm install qiitable
```

Parse a query string:

```js
var qiitable = require("qiitable");

var query = qiitable.Query('Ruby created:>=2020-01-01').parse();
```

Filter and customize queries using `QueryBuilder`:

```js
var builder = qiitable.QueryBuilder();

// Define mapping, by default all fields are accepted and piped as string
builder.field('stocks', {
    type: Number
});
builder.field('created', {
    type: Date
});

// Reject a field
builder.reject('email');

// Parse queries (return a Query object)
builder.parse('Ruby stocks:>=10 created:>=2020-01-01')
```

### Origin

This project started as a fork of [GitbookIO/filterable](https://github.com/GitbookIO/filterable).

---
_Source: https://npm.io/package/qiitable · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
