
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
urlfactory-js
Advanced tools
This library helps you handling and building the urls depending on current environment.
yarn add urlfactory-js
or
npm i urlfactory-js --save
Create the UrlFactory:
const UrlFactory = require('urlfactory-js');
const urlConfig = require('../../config/urls/urls.config.json'); // path to urls config file
const urlFactory = new UrlFactory(urlConfig, 'DEV'); // 'DEV' is the name of the environment you want to use
Get the urls:
const url = urlFactory.getUrl('RETRIEVE_FAQ');
Here you can see an example:
{
"$schema": "https://raw.githubusercontent.com/gianlucaparadise/urlfactory-js/master/urls.schema.json",
"hosts": {
"DEV": {
"default": "http://dev.example.com",
"CMS": "https://dev.wpexample.com",
"PROFILER": "https://dev.profiler.com"
},
"TEST": {
"default": "http://test.example.com",
"CMS": "https://test.wpexample.com",
"PROFILER": "https://test.profiler.com"
}
},
"urls": {
"RETRIEVE_ZONES": {
"hostKey": "CMS",
"path": "/api/zones"
},
"RETRIEVE_FAQ": {
"hostKey": "CMS",
"path": "/api/faqs"
},
"RETRIEVE_USER": {
"hostKey": "PROFILER",
"path": "/api/user"
},
"CHANGE_PASSWORD": {
"hostKey": "PROFILER",
"path": "/api/password/change"
},
"CONTACT_US": {
"hostKey": "PROFILER",
"path": "/api/contact"
},
"RETRIEVE_TICKETS_MISSING_HOST": {
"hostKey": "TICKETS",
"path": "/api/tickets"
},
"RETRIEVE_USER_FORMATTED": {
"hostKey": "CMS",
"path": "/{0}/user/{1}"
}
}
}
You can write your configurations in a file named *.urls.json
. For applying the JSON Schema validator in VS Code, add this configuration in your settings.json
file:
"json.schemas": [
{
"fileMatch": [
"/*.urls.json"
],
"url": "https://raw.githubusercontent.com/gianlucaparadise/urlfactory-js/master/urls.schema.json"
}
]
Otherwise you can include this line on top of your config file (see Config Example)
"$schema": "https://raw.githubusercontent.com/gianlucaparadise/urlfactory-js/master/urls.schema.json"
FAQs
This library builds the urls depending on the selected environment
The npm package urlfactory-js receives a total of 0 weekly downloads. As such, urlfactory-js popularity was classified as not popular.
We found that urlfactory-js 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.