1.0.2 • Published 6 years ago
orxapi.tools.url v1.0.2
orxapi.tools.url
The URL tools library for orxapi.
Getting Started
If you haven't used NodeJs before, be sure to have install the LTS version on your desktop ! Check your version with this command:
node -v
v6.9.2
Installation
npm install orxapi.tools.url --save-dev
This library is written in TypeScript, but you can use JavaScript.
Usage
TypeScript code
import { getParameterString } from "orxapi.tools.url";
// Get parameter as string
const param = getParameterString();
Methods
- getUrlVar Get the URL parameters
- getUrlHashVar Get the URL hash parameters
- getQueryString TGet the URL query string
- getParameterString Get parameter as string
- getAbsoluteUrl Get the absolute url from a relative one
- addUrlParameter Add a new value on the query
- addUrlQuery Add all query to an existing query
- buildParameters Converts urlVarsParameters to string
- removeParameters Build Url with URL and parameters
See docs for more informations
This library was designed to work with ES 5+
TODO
- Add unit tests
- Improve the documentation
- V2 add class with methods