0.2.2 • Published 5 years ago

ixi v0.2.2

Weekly downloads
11
License
Anti 996
Repository
github
Last release
5 years ago

npm Build Status LICENSE

structure selection parser.

Fork x-ray-select, with:

  • built-in filters: trim, reverse, slice, lowercase, uppercase, date
  • trim string by default
  • fix $root in array structure

Install

yarn add ixi
# or
npm install ixi

Usage

const X = require('ixi')

const html = `<div>
  <h1>ixi</h1>
  <ul>
    <li>one</li>
    <li>two</li>
    <li>three</li>
  </ul>
</div>`

const x = X(html)

console.log(x('h1')) // 'ixi'

console.log(x(['li'])) // ['one', 'two', 'three']

console.log(
  x({
    title: 'h1',
    items: ['li']
  })
)
// {
//   title: 'ixi',
//   items: ['one', 'two', 'three']
// }

console.log(
  x({
    $root: '.main',
    title: 'h1',
    items: ['li']
  })
)
// {
//   title: 'ixi',
//   items: ['one', 'two']
// }

License

Anti 996

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.0

5 years ago