gmail-filter-query-parser
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.4 • Public • Published

    Gmail Filter Query Parser

    A nearley based parser to parse/serialise Gmail filter query.

    Installation

    npm install gmail-filter-query-parser

    Usage

    import { parse, serialise, HasAttachment, Subject } from 'gmail-filter-query-parser'
     
    const parsed = parse('subject:(invoice) AND has:attachment')
    console.log(parsed)
    // { $and: [ { value: 'subject:(invoice)' }, { value: 'has:attachment' } ] }
     
    const serialised = serialise(AND(
      Subject('invoice'),
      HasAttachment(),
    ))
    console.log(serialised)
    // 'subject:(invoice) AND has:attachment'

    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

    Keywords

    none

    Install

    npm i gmail-filter-query-parser

    DownloadsWeekly Downloads

    0

    Version

    0.0.4

    License

    MIT

    Unpacked Size

    12.3 kB

    Total Files

    11

    Last publish

    Collaborators

    • zorji