Swiftpack.co - salishseasoftware/Stringy as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by salishseasoftware.
salishseasoftware/Stringy 1.0.0
Some handy string conversions
⭐️ 0
🕓 1 year ago
.package(url: "https://github.com/salishseasoftware/Stringy.git", from: "1.0.0")

Build & Test Latest Release Swift 5.5+ Swift Package Manager License

Stringy

Handy string conversions

Requirements

  • Swift 5.5+
  • Xcode 13.0+
  • macOS 11.0+

Command Line Tool

A Mac OS command line tool to perform some handy string conversions

Usage

OVERVIEW: Handy string conversions

USAGE: stringy <subcommand>

OPTIONS:
  -h, --help              Show help information.

SUBCOMMANDS:
  camelcase               Converts strings to camelCase
  snakecase               Converts strings to snake_case.
  kebabcase               Converts strings to kebab-case.

  See 'stringy help <subcommand>' for detailed help.

Subcommands

camelcase

OVERVIEW: Converts strings to camelCase

E.G. Earth Sun Moon -> earthSunMoon

USAGE: stringy camelcase [--invert] [<strings> ...]

ARGUMENTS:
  <strings>

OPTIONS:
  -i, --invert            Inverts the conversion. 
  -h, --help              Show help information.

snakecase

OVERVIEW: Converts strings to snake_case.

E.G. 'Snakes are slithery' -> 'snakes_are_slithery'

USAGE: stringy snakecase [--invert] [<strings> ...]

ARGUMENTS:
  <strings>

OPTIONS:
  -i, --invert            Inverts the conversion. 
  -h, --help              Show help information.

kebabcase

OVERVIEW: Converts strings to kebab-case.

E.G. 'Words on a stick' -> 'words-on-a-stick'

USAGE: stringy kebabcase [--invert] [<strings> ...]

ARGUMENTS:
  <strings>

OPTIONS:
  -i, --invert            Inverts the conversion. 
  -h, --help              Show help information.

Installation

With Mint

$ mint install salishseasoftware/stringy

Manually

Clone the repo then:

$ make install

Or using swift itself:

$ swift build -c release
$ cp .build/release/stringy /usr/local/bin/stringy

With Xcode

Generate the Xcode project:

$ swift package generate-xcodeproj
$ open ./Stringy.xcodeproj

In Xcode:

  1. Product > Archive
  2. Distribute Content
  3. Built Products
  4. copy the stringy executable to /usr/local/bin/, or wherever you prefer.

LibStringy

A package of handy String and StringProtocol extensions.

String

Some general utility String extensions.

String+DataDetector

Makes use of NSDataDetector to parse known data types from a string.

String+Error

Extends String to conform to the Error protocol.

This allows throwing a simple string. E.G. throw "Foo".

StringProtocol

Some general utility StringProtocol extensions.

StringProtocol+Stringy

Some handy conversions.

For example:

  • camelcased()
  • snakecased()
  • kebabcased()

GitHub

link
Stars: 0
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

1.0.0
1 year ago
  • bb10290 Add badges to Readme.
  • 2819406 Add change log.
  • e819863 Add github badge.
  • e0aebfd Add github worklow.
  • 2a3cfdd Include xcshareddata.
  • 87576f4 Update swift-tools-version to 5.5.
  • 26d759f Update ReadMe.
  • 148f90c Add license file.
  • 90b4fb5 Fix some typos.
  • dfd67ea Update swift package manager.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics