
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
fixturl
is a small library for generating url test fixtures.
$ npm install --save fixturl
var fixturl = require('fixturl'),
// fixturl(String, Object or Array);
fixtures = fixturl('http://www.domain.com/:path', {
param: {
path: 'news'
},
query: {
foo: 'bar'
}
});
Example invocation
Behind the scenes fixturl
uses reverend to support express like route parameter subsitution.
Should you wish to generate multiple combinations for a url this is possible by specifying an array for either params for query.
fixturl('/some/path/:id', {
param: [
{ id: '12345' },
{ id: '6789' }
],
query: [
{ foo: 'bar' },
{ foo: 'bar', buzz: 'fizz' }
]
});
Example of url combinations
fixturl
will return an array containing generated fixtures. For convenience the following additional Array methods are made available.
fixtures.first(); // Returns the first item in the array.
fixtures.last(); // Returns the last item in the array.
fixtures.random(); // Returns a random item in the array.
Copyright (c) 2014 Jonathan Barnett. Licensed under the MIT license.
FAQs
Pattern based fixture generator for urls
We found that fixturl 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.