typescript-urlmaki
v0.0.4
Published
Typescript URL Utilities.
Downloads
3
Maintainers
Readme
typescript-urlmaki
Typescript library ( used for Angular 2 projects ) with basic url parse and tools.
Note: this solutions is not production ready, it's in a very basic alpha state and have basic methods implemented, in a very short time will update with more tools and features.
Installation
npm install typescript-urlmaki
Example
import {URLTools} from 'typescript-urlmaki/typescript-urlmaki';
@Component({
selector: 'my-app',
template: `
....
`,
providers: [URLTools]
})
export class AppComponent {
constructor(public urltools: URLTools) {
if (this.urltools.isURL("www.google.com")){
console.log("esiste ");
}
//OR
this.urltool.join("www.google.com","test","miao.html");
// return www.google.com/test/miao.html
}
}
API Docs
URLTools
Methods:
isURL(url: string): boolean
: parse the string anc check if is am URL or notjoin(...args): string
: Join the arguments passed and return a formatted url
License
MIT