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
- Host: GitHub
- URL: https://github.com/scalajs-io/cheerio
- Owner: scalajs-io
- License: apache-2.0
- Created: 2017-02-05T03:03:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-17T23:07:41.000Z (about 6 years ago)
- Last Synced: 2025-01-17T22:42:48.232Z (5 months ago)
- Topics: cheerio, jquery, node, nodejs, npm, npm-package, scala
- Language: Scala
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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")
```