# snapdragon-cheerio

> Snapdragon plugin for converting a cheerio AST to a snapdragon AST.

Latest version **1.1.0** (published 2017-02-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install snapdragon-cheerio
pnpm add snapdragon-cheerio
yarn add snapdragon-cheerio
bun add snapdragon-cheerio
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-02-15 |
| First published | 2017-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | html, ast, nodes, cheerio, compile, compiler, convert, parse, parser, render, snapdragon, transform |

## Links

- npm: https://www.npmjs.com/package/snapdragon-cheerio
- Repository: https://github.com/jonschlinkert/snapdragon-cheerio
- Issues: https://github.com/jonschlinkert/snapdragon-cheerio/issues
- npm.io page: https://npm.io/package/snapdragon-cheerio

## Dependencies (6)

- [cheerio](https://npm.io/package/cheerio.md) ^0.22.0
- [extend-shallow](https://npm.io/package/extend-shallow.md) ^2.0.1
- [define-property](https://npm.io/package/define-property.md) ^0.2.5
- [is-self-closing](https://npm.io/package/is-self-closing.md) ^1.0.0
- [snapdragon-node](https://npm.io/package/snapdragon-node.md) ^1.0.6
- [snapdragon-util](https://npm.io/package/snapdragon-util.md) ^2.0.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2017-02-15
- 1.0.1 — 2017-02-03
- 1.0.0 — 2017-01-21
- 0.1.0 — 2017-01-03

## README

# snapdragon-cheerio [![NPM version](https://img.shields.io/npm/v/snapdragon-cheerio.svg?style=flat)](https://www.npmjs.com/package/snapdragon-cheerio) [![NPM monthly downloads](https://img.shields.io/npm/dm/snapdragon-cheerio.svg?style=flat)](https://npmjs.org/package/snapdragon-cheerio)  [![NPM total downloads](https://img.shields.io/npm/dt/snapdragon-cheerio.svg?style=flat)](https://npmjs.org/package/snapdragon-cheerio) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/snapdragon-cheerio.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/snapdragon-cheerio)

> Snapdragon plugin for converting a cheerio AST to a snapdragon AST.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save snapdragon-cheerio
```

## Usage

Use the `.parse` method directly to return an AST:

```js
var snapdragonCheerio = require('snapdragon-cheerio');
var ast = snapdragonCheerio.parse('<strong>It worked!</strong>');
console.log(ast);
// Node {
//   type: 'string',
//   nodes:
//    [ Node { type: 'bos', val: '', index: 0 },
//      Node { type: 'strong', attribs: {}, index: 1, nodes: [Object] },
//      Node { type: 'eos', val: '', index: 2 } ] }
```

**Snapdragon plugin usage**

Pass to [snapdragon](https://github.com/jonschlinkert/snapdragon)'s `.use` method to use as a plugin:

```js
var snapdragonCheerio = require('snapdragon-cheerio');
var Snapdragon = require('snapdragon');
var snapdragon = new Snapdragon();
snapdragon.use(snapdragonCheerio());

var ast = snapdragon.parse('<strong>It worked!</strong>');
// Node {
//   type: 'string',
//   nodes:
//    [ Node { type: 'bos', val: '', index: 0 },
//      Node { type: 'strong', attribs: {}, index: 1, nodes: [Object] },
//      Node { type: 'eos', val: '', index: 2 } ] }
```

Visit [snapdragon](https://github.com/jonschlinkert/snapdragon) to learn how to compile the generated AST into a string.

## About

### Related projects

* [cheerio](https://www.npmjs.com/package/cheerio): Tiny, fast, and elegant implementation of core jQuery designed specifically for the server | [homepage](https://github.com/cheeriojs/cheerio#readme "Tiny, fast, and elegant implementation of core jQuery designed specifically for the server")
* [snapdragon-capture-set](https://www.npmjs.com/package/snapdragon-capture-set): Plugin that adds a `.captureSet()` method to snapdragon, for matching and capturing substrings that have… [more](https://github.com/jonschlinkert/snapdragon-capture-set) | [homepage](https://github.com/jonschlinkert/snapdragon-capture-set "Plugin that adds a `.captureSet()` method to snapdragon, for matching and capturing substrings that have an `open` and `close`, like braces, brackets, etc")
* [snapdragon-capture](https://www.npmjs.com/package/snapdragon-capture): Snapdragon plugin that adds a capture method to the parser instance. | [homepage](https://github.com/jonschlinkert/snapdragon-capture "Snapdragon plugin that adds a capture method to the parser instance.")
* [snapdragon-node](https://www.npmjs.com/package/snapdragon-node): Snapdragon utility for creating a new AST node in custom code, such as plugins. | [homepage](https://github.com/jonschlinkert/snapdragon-node "Snapdragon utility for creating a new AST node in custom code, such as plugins.")
* [snapdragon-util](https://www.npmjs.com/package/snapdragon-util): Utilities for the snapdragon parser/compiler. | [homepage](https://github.com/jonschlinkert/snapdragon-util "Utilities for the snapdragon parser/compiler.")
* [snapdragon](https://www.npmjs.com/package/snapdragon): Easy-to-use plugin system for creating powerful, fast and versatile parsers and compilers, with built-in source-map… [more](https://github.com/jonschlinkert/snapdragon) | [homepage](https://github.com/jonschlinkert/snapdragon "Easy-to-use plugin system for creating powerful, fast and versatile parsers and compilers, with built-in source-map support.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.

### Building docs

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
MIT

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 15, 2017._

---
_Source: https://npm.io/package/snapdragon-cheerio · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
