ixi
v0.2.2
Published
structure selection parser.
Downloads
8
Readme
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']
// }