https://github.com/scalajs-io/splitargs
Splits strings into tokens by given separator except treating quoted part as a single token.
https://github.com/scalajs-io/splitargs
node nodejs npm scala scalajs
Last synced: 4 months ago
JSON representation
Splits strings into tokens by given separator except treating quoted part as a single token.
- Host: GitHub
- URL: https://github.com/scalajs-io/splitargs
- Owner: scalajs-io
- License: apache-2.0
- Created: 2017-02-06T04:10:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-17T23:11:20.000Z (about 6 years ago)
- Last Synced: 2025-01-17T22:42:26.394Z (5 months ago)
- Topics: node, nodejs, npm, 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
SplitArgs API for Scala.js
================================
[splitargs](https://www.npmjs.com/package/splitargs) - Splits strings into tokens by given separator except treating quoted part as a single token.### Description
Splits strings into tokens by given separator except treating quoted part as a single token.
### 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.nodejs.Assert
import io.scalajs.npm.splitargs._
import scala.scalajs.jsval line = "I said 'I am sorry.', and he said \"it doesn't matter.\""
val args = SplitArgs(line)
Assert.deepEqual(args, js.Array("I", "said", "I am sorry.,", "and", "he", "said", "it doesn\'t matter."))
```### Artifacts and Resolvers
To add the `SplitArgs` binding to your project, add the following to your build.sbt:
```sbt
libraryDependencies += "io.scalajs.npm" %%% "splitargs" % "0.5.0"
```Optionally, you may add the Sonatype Repository resolver:
```sbt
resolvers += Resolver.sonatypeRepo("releases")
```