0.7.9 • Published 7 years ago

fx-query v0.7.9

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

fx-query

Make queries in html returned by html-parse-regex

I will help if you have any difficulty =)

Contact me by github:heyderpd. I'll be glad to help you.

Thanks for npm~lucasmreis

Important!!! Both functions are already using memorize dejavu-call, so repeated queries will not worsen performance.

To run query directly

Example:

import parse from 'html-parse-regex'
import { runQuery } from 'fx-query'

const queryString = `
  all with tag 'a'
  get attr 'href'`
const html = parse(htmlString)
const links = runQuery(html, queryString) // [ www.aaa.com, www.bbb.com ]

If need compile the query and execute in many files.

Example:

import parse from 'html-parse-regex'
import { compileQuery } from 'fx-query'

const getAllLinks = compileQuery(`
  all with tag 'a'
  get attr 'href'`)
const htmlA = parse(htmlStringA)
const htmlB = parse(htmlStringB)
const links = getAllLinks(htmlA) // [ www.aaa.com, www.bbb.com ]
const links = getAllLinks(htmlB) // [ www.ccc.com, www.ddd.com ]
0.7.9

7 years ago

0.7.8

7 years ago

0.7.7

7 years ago

0.7.5

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.0.0

7 years ago