Skip to content

scalajs-io/splitargs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SplitArgs API for Scala.js

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

Build/publish the SDK locally

 $ sbt clean publish-local

Running the tests

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

$ npm install

Then you can run the tests:

$ sbt test

Examples

import io.scalajs.nodejs.Assert
import io.scalajs.npm.splitargs._
import scala.scalajs.js

val 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:

libraryDependencies += "io.scalajs.npm" %%% "splitargs" % "0.5.0"

Optionally, you may add the Sonatype Repository resolver:

resolvers += Resolver.sonatypeRepo("releases") 

About

Splits strings into tokens by given separator except treating quoted part as a single token.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages