An open API service indexing awesome lists of open source software.

https://github.com/terrierscript/migawari

Create html from css query selector.
https://github.com/terrierscript/migawari

Last synced: 10 months ago
JSON representation

Create html from css query selector.

Awesome Lists containing this project

README

          

# Migawari ![travis](https://travis-ci.org/suisho/migawari.svg)

> Create html from css query selector.

## Sample Usage

```js
var migawari = require("migawari")
migawari('a'); //
migawari('.c'); //


migawari('#d'); //

migawari('a[title="foo"]'); //
migawari('a > b'); //
migawari('a , b'); //
migawari('a + b'); //
migawari('a > b + .c'); //

// descendant and sibilings insert dummy
migawari('a ~ b'); //


migawari('a b'); //

```
# API

## toString()

Output html.

## dom

Return Dom object for [htmlparser2](https://github.com/fb55/htmlparser2)
If you want customize output. You can use this.

# Options

## option.dummy (default=div)
Change dummy tag name.

sample:

```js
migawari("a b ~ p",{dummy:"span"}).toString()
// =>

migawari(".c", {dummy: "span"}).toString()
// => ''
```