Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
outperform
Advanced tools
Outperform is a form generator written in plain Javascript with zero dependencies. It supports and augments browser native form validation and offers automatic persistence of half-filled forms across page reloads while integrating with any and all web frameworks.
It runs inside any webbrowser environment (starting at IE11 and up).
id
DOM-namespace by using form-relative
name
references internally exclusively. var fields = [
[ "houseno", "number", "This is the description", {min:1, max:999}],
[ "foo", "text", "This is the description",
{validate:function(flds) {
if (flds.foo.value != flds.foo2.value)
return "Mismatch between foo en foo2 fields";
}],
[ "foo2", "password", "This is the description"],
[ "bar", "select", "This is the description",
{list:
["one",
["two", {class:"bright"}],
["three", "Three choices"],
"four",
["five", "Five", {style:"display:none;"}],
]
}
],
[ "bar2", "checkbox", "This is the description",
{list:
["one",
["two", {class:"bright", value:"2"}],
["Three choices"],
"four",
["Five", {style:"display:none;", value:"5"}],
],
template:"<fieldset><legend></legend><input /></fieldset>",
labelsel:"legend",
}
],
];
var form = Outperform.create("form", {id:"hello"}, fields);
document.body.appendChild(form);
// on submit:
if (form.reportValidity()) {
console.log(JSON.stringify(Outperform.getfields(form)));
Outperform.clearpersist(form);
}
Fielddescriptions are an array of values:
[ name, type, description, options]
name
type
select
or textarea
, which generate
corresponding input fields.description
options
template
<label><span></span><input /></label>
And can be specified per input field if so desired.labelsel
span
And identifies the first element whose content shall be replaced
by the human readable form of the description of the input field.persist
true
for all types except
password
.validate
node
list
select
, checkbox
or radio
element.
Every entry needs to satisfy the following rules:
select
values should contain one or two strings (separate value
is optional) followed by an optional option object per row.checkbox
and radio
values should contain a single string,
or a single string followed by an option object, or a full
fielddescription array (the latter can be used to recursively
nest arbitrarily complex HTML structures in the form).Specified parameters:
form
fielddescription
fields
fielddescription
fields.Exposed API-list:
Outperform.create(formtag, attributes, fields)
formtag
(usually "form"
, unless you deviate from HTML5) adorned by the
attributes listed in the attributes
object. The form is filled
using the fielddescriptions in the fields
array. It returns
a reference to the form node which should normally be inserted into
the DOM.Outperform.clearpersist(form)
Outperform.getvalues(form)
Outperform.setvalues(form, values)
values
.Outperform.obj2formdata(values)
formData
object.Outperform.field(form, fielddescription)
fielddescription
(used internally by Outperform.create()
). This method can be used
to construct completely custom form elements, by inserting them
manually into the form created by Outperform.create()
.Card-carrying member of the zerodeps
movement.
FAQs
Form generator using plain javascript
The npm package outperform receives a total of 0 weekly downloads. As such, outperform popularity was classified as not popular.
We found that outperform 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.