@jswork/next-url-operator

1.0.7 • Public • Published

next-url-operator

Operator for url.

version license size download

installation

npm install -S @jswork/next-url-operator

apis

api params description
get (name: string) Get param by name.
gets - Get all parmas.
set (name:string, value:string) Set param value
sets (object:any) Update params value.
update(public) (object):string Update params and get the new url.
url(public) location.href The current url.

usage

import NxUrlOperator from '@jswork/next-url-operator';

const op = new NxUrlOperator({ url: 'https://www.baidu.com?q=hello' });
const url = op.update({ q: 'world'});

//https://www.baidu.com?q=world

// static method
NxUrlOperator.update({
  q: 'hello'
});

// http://locahost?q=hello

license

Code released under the MIT license.

/@jswork/next-url-operator/

    Package Sidebar

    Install

    npm i @jswork/next-url-operator

    Homepage

    js.work

    Weekly Downloads

    4

    Version

    1.0.7

    License

    MIT

    Unpacked Size

    8.9 kB

    Total Files

    8

    Last publish

    Collaborators

    • afeiship
    • yujiao.luo