
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Parse and set url search parameters.
English | 简体中文
queryParam
gets the value of a parameter in window.location.search
or a string that matches the rule.
setParams
sets the value of one or more parameters in window.location.search
or a string that matches the rule, and returns [url]?p1=1&p2=2&p3=3
.
npm i gb-url
import { setParams, queryParam } from "gb-url";
/**
* gbUrl.queryParam(key, url);
* @param key [Name of the parameter to get]
* @param url [The URL to be resolved or a string that matches the rule, default is window.location.href]
**/
const url = "a.html?a=1&b=2&c=3";
queryParam("a", url); // 1
queryParam("b", url); // 2
/**
* gbUrl.setParams(params, url);
* @param params [Object to be set, assigned (key,value)]
* @param url [The URL to be resolved or a string that matches the rule, default is window.location.href]
**/
const url = "a.html?a=1&b=2&c=3";
setParams(
{
a: "11111",
},
url
); // "a.html?a=11111&b=2&c=3"
setParams(
{
b: "2222",
c: "3333",
d: "4444",
},
url
); // "a.html?a=1&b=2222&c=3333&d=4444"
FAQs
Parse and set url search parameters
We found that gb-url demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.