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

https://github.com/scalajs-io/cheerio

Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
https://github.com/scalajs-io/cheerio

cheerio jquery node nodejs npm npm-package scala

Last synced: 4 months ago
JSON representation

Tiny, fast, and elegant implementation of core jQuery designed specifically for the server

Awesome Lists containing this project

README

        

Cheerio API for Scala.js
================================
[cheerio](https://www.npmjs.com/package/cheerio) - A tiny, fast, and elegant implementation of core jQuery designed specifically for the server.

### Description

Fast, flexible & lean implementation of core jQuery designed specifically for the server.

### Build Requirements

* [SBT v1.2.x](http://www.scala-sbt.org/download.html)

### Build/publish the SDK locally

```bash
$ sbt clean publish-local
```

### Running the tests

Before running the tests the first time, you must ensure the npm packages are installed:

```bash
$ npm install
```

Then you can run the tests:

```bash
$ sbt test
```

### Examples

```scala
import io.scalajs.npm.cheerio._

val input = """

Hello world

"""
val $ = Cheerio.load(input)

$("h2.title").text("Hello there!")
$("h2").addClass("welcome")

val output = $.html()
println(s"after: $output") // =>

Hello there!


```

### Artifacts and Resolvers

To add the `Cheerio` binding to your project, add the following to your build.sbt:

```sbt
libraryDependencies += "io.scalajs.npm" %%% "cheerio" % "0.5.0"
```

Optionally, you may add the Sonatype Repository resolver:

```sbt
resolvers += Resolver.sonatypeRepo("releases")
```