ixi

0.2.2 • Public • Published
ixi

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

Package Sidebar

Install

npm i ixi

Weekly Downloads

2

Version

0.2.2

License

Anti 996

Unpacked Size

8.24 kB

Total Files

5

Last publish

Collaborators

  • o_0
  • yahtnif