https://github.com/scalajs-io/buffermaker
buffermaker is a convenient way of creating binary strings
https://github.com/scalajs-io/buffermaker
nodejs npm scala scalajs
Last synced: 4 months ago
JSON representation
buffermaker is a convenient way of creating binary strings
- Host: GitHub
- URL: https://github.com/scalajs-io/buffermaker
- Owner: scalajs-io
- License: apache-2.0
- Created: 2017-02-05T04:47:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-17T23:07:27.000Z (about 6 years ago)
- Last Synced: 2025-01-17T22:42:55.842Z (5 months ago)
- Topics: nodejs, npm, scala, scalajs
- Language: Scala
- Size: 14.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
BufferMaker API for Scala.js
================================
[buffermaker](https://www.npmjs.com/package/buffermaker) - A buffermaker is a convenient way of creating binary strings.### Description
A convenient way of creating binary strings in node.js because Buffer is a bit too low-level for comfort in this regard.
### 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.buffermaker._
import io.scalajs.npm.bignum.BigNumval someBuffer = new BufferMaker()
.UInt8(1)
.UInt16BE(2)
.UInt32BE(3)
.Int64BE(new BigNum("4")) // uses the BigNum library
.string("this is a test!")
.make()println(someBuffer.toString()) //=>
```### Artifacts and Resolvers
To add the `BufferMaker` binding to your project, add the following to your build.sbt:
```sbt
libraryDependencies += "io.scalajs.npm" %%% "buffermaker" % "0.5.0"
```Optionally, you may add the Sonatype Repository resolver:
```sbt
resolvers += Resolver.sonatypeRepo("releases")
```