
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
It will take a URL and the object keys as arguments and convert it to an object. It support query params by using the names as obj keys.
It will take a URL and the object keys as arguments and convert it to an object. You can pass an array of keys or just a string with the url format. It support query params by using the names as obj keys.
url2obj( url, object keys, omit certain keys );
url2obj( url, format url string);
$ npm install --save url2obj
first argument is the url that you want to convert, then you can pass an array of keys and then an array of the keys that you want to omit on your obj
var url2obj = require('url2obj');
var obj1 = url2obj( '/4/api/users/2', ['version', 'api', 'collection', 'id'], ['api'] );
// This will return an object like this:
{
version: "4",
collection: "users",
id: "2"
}
var obj2 = url2obj( '/4/api/users/2?sort=desc&limit=10', ['version', 'api', 'collection', 'id'], ['api'] );
// If you have query params on your url it will use the names as keys:
{
version: "4",
collection: "users",
id: "2",
sort: "desc",
limit: "10"
}
you have the option to pass only two arguments being the first one the url and the second one the format of your url, it will take the dynamic params as keys and omit the non dynamic ones.
var url2obj = require('url2obj');
var obj1 = url2obj( '/6/api/listings/3', "/:version/api/:collection/:id" );
// This will return an object like this:
{
version: "4",
collection: "users",
id: "2"
}
var obj2 = url2obj( '/6/api/listings/3?sort=desc&limit=10', "/:version/api/:collection/:id" );
// If you have query params on your url it will use the names as keys:
{
version: "4",
collection: "users",
id: "2",
sort: "desc",
limit: "10"
}
# creates a browser.js
$ npm run browser
MIT © Sebastian Baroni
FAQs
It will take a URL and the object keys as arguments and convert it to an object. It support query params by using the names as obj keys.
We found that url2obj 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.