
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
param-handler
Advanced tools
this is a library that allowes you to control query params location search
-it also allows you to change it without reloading the page. useful for virtual doms like (react, svelte, angular .. etc).
-it has callback when each variable changes (you have to use the same package for it to work).
-made with typescript!.
-it can return an object with these variable instead of a boaring string, for example: "?a=5&b=dad" => {a:5,b:"dad"}
-in your command promp type:
npm install param-handler
Its easy, you will need jsdom if you don't have a dom(plain nodejs),
first of all you need to import the package:
let {ParamsHandler} = require("param-handler")
// or
import {ParamsHandler} from "param-handler"
Then
let ph = paramsHandler(window) // pass the window from the virtual dom
or if you're into classes
let {QParamer} = require("param-handler")
// or
import {QParamer} from "param-handler"
Then
let ph = new QParamer(window) // pass the window from the virtual dom
Then you can start using it!
Well its easy.
You can just use
ph.set("name_of_the_variable", "the_new_value")
You have two choises:
ph.on("change", "name_of_the_variable", (new_value)=>{
console.log(`name_of_the_variable has changed to ${new_value}!`)
})
note that you can use the second argument inside the callbackfunction to call "this".
console.log(`name_of_the_variable has the value of ${ph.get("name_of_the_variable")}`)
console.log(`the fancy object ${ph.params}`)
console.log(`does name_of_the_variable exists?`)
console.log(ph.exists("name_of_the_variable")?"YES":"no :(")
FAQs
this is a library that allowes you to control query params location search
We found that param-handler 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.