1.0.4 • Published 9 months ago

imap-criteria-transpiler v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

imap-criteria-transpiler

Description

imap-criteria-transpiler is a library for transpiling intuitive queries into Imap criterias.

Installation

# with npm
npm install --save imap-criteria-transpiler

# with yarn
yarn add imap-criteria-transpiler

# with pnpm
pnpm add imap-criteria-transpiler

Documentation

You can use logic doors like AND, OR, NOT, ... (more will be added in the future)

You can use parentesis to manage priority levels

You can use simple quotes or double quotes to escape spaces or logic doors. You also can escaping spaces with anti-slashes

Examples

import transpiler from 'imap-criteria-transpiler'

const query = 'from:foo AND to:bar'

const criteria = transpiler.parse(query)

console.log(criteria) // [['HEADERS', 'FROM', 'foo'], ['HEADERS', 'TO', 'bar']]

imap.search(criteria, (err, uuids) => {
  // Do anything you want
})
1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago