2016-02-23 01:57:12 +00:00
|
|
|
# smartstring
|
2016-05-25 07:02:24 +00:00
|
|
|
handle strings in smart ways. TypeScript ready.
|
2016-05-16 22:02:29 +00:00
|
|
|
|
|
|
|
## Status
|
|
|
|
[![Build Status](https://travis-ci.org/pushrocks/smartstring.svg?branch=master)](https://travis-ci.org/pushrocks/smartstring)
|
|
|
|
[![Dependency Status](https://david-dm.org/pushrocks/smartstring.svg)](https://david-dm.org/pushrocks/smartstring)
|
|
|
|
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartstring/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartstring/master/dependencies/npm)
|
|
|
|
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartstring/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartstring)
|
|
|
|
|
|
|
|
## Usage
|
2016-05-25 07:02:24 +00:00
|
|
|
Use TypeScript for intellisense.
|
|
|
|
|
|
|
|
```typescript
|
|
|
|
import * as smartstring from "smartstring";
|
|
|
|
|
|
|
|
// smartstring.GitRepo class
|
|
|
|
let myGitRepo = new smartstring.GitRepo("git@github.com:someorg/somerepo.git"); // takes https and git and npm repo URL versions
|
|
|
|
myGitRepo.host // "github.com"
|
|
|
|
myGitRepo.user // "someorg"
|
|
|
|
myGitRepo.repo // "somerepo"
|
|
|
|
myGitRepo.accessToken // accessToken if specified with https
|
2016-05-25 07:10:43 +00:00
|
|
|
myGitRepo.sshUrl // "git@github.com:someorg/somerepo.git" (computed also from https)
|
|
|
|
myGitRepo.httpsUrl // "https://github.com/someorg/somerepo.git" (computed also from ssh)
|
2016-05-25 07:02:24 +00:00
|
|
|
|
|
|
|
// smartstring.Domain class
|
|
|
|
let myDomain = new smartstring.Domain("https://sub.main.tld");
|
|
|
|
myDomain.level1 // "tld"
|
|
|
|
myDomain.level2 // "main"
|
|
|
|
// level3 , level 4 and so on...
|
|
|
|
myDomain.zoneName // "main.tld"
|
|
|
|
myDOmain.protocol // "https"
|
|
|
|
|
|
|
|
```
|
2016-05-25 07:05:04 +00:00
|
|
|
|
|
|
|
## About the authors:
|
|
|
|
[![Project Phase](https://mediaserve.lossless.digital/lossless.com/img/createdby_github.svg)](https://lossless.com/)
|
|
|
|
|
|
|
|
[![PayPal](https://img.shields.io/badge/Support%20us-PayPal-blue.svg)](https://paypal.me/lossless)
|