WMXPY / url-var

get var from url

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

url-var

npm version downloads

Install

    npm i url-var --save

Usage

import a from 'url-var';

//address: http://example.something/?a=10&b=20
a.url('a'); // = 10
a.url('a','b'); // = {a:10,b:20}

//address: whatever
a.str('http://example.something/?a=10&b=20','a') // = 10
a.str('http://example.something/?a=10&b=20','a','b') // = {a:10,b:20}

About

get var from url

License:MIT License


Languages

Language:JavaScript 100.0%