https://github.com/scalajs-io/oppressor
Streaming http compression response negotiator
https://github.com/scalajs-io/oppressor
node nodejs npm npm-package scala scalajs
Last synced: 4 months ago
JSON representation
Streaming http compression response negotiator
- Host: GitHub
- URL: https://github.com/scalajs-io/oppressor
- Owner: scalajs-io
- License: apache-2.0
- Created: 2017-02-07T00:44:19.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-17T23:10:46.000Z (about 6 years ago)
- Last Synced: 2025-01-17T22:42:28.441Z (5 months ago)
- Topics: node, nodejs, npm, npm-package, scala, scalajs
- Language: Scala
- 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
Oppressor API for Scala.js
================================
[oppressor](https://www.npmjs.com/package/oppressor) - streaming http compression response negotiator.
### Description
streaming http compression response negotiator### Build Dependencies
* [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.nodejs.fs.Fs
import io.scalajs.nodejs.http._
import io.scalajs.npm.oppressor._val server = Http.createServer((req: ClientRequest, res: ServerResponse) => {
Fs.createReadStream("./src/test/resources/data.txt")
.pipe(Oppressor(req))
.pipe(res)
})
server.listen(8000)
```### Artifacts and Resolvers
To add the `Oppressor` binding to your project, add the following to your build.sbt:
```sbt
libraryDependencies += "io.scalajs.npm" %%% "oppressor" % "0.5.0"
```Optionally, you may add the Sonatype Repository resolver:
```sbt
resolvers += Resolver.sonatypeRepo("releases")
```