
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
Form validation helper
form = new ldform(config);
ldform automatically scan every input fields by \*[name] selector, so you must provide name attributes for each input or .form-control element:
<input type="text" name="username"/>
<textarea class="form-control" name="description"/>
Or, you can specify your own getFields function to apply your own rules.
Additionally, if you have an element with its type being 'submit', ldform will automatically remove it's 'disabled' class when validation passed. You can overwrite this behavior by manually specify a submit element with submit option.
For nested form, simply add a ldform attribute as scoping element to separate them:
<div ldform>
<input name="a">
<div ldform>
<!-- b is scoped and won't be handled, unless we have another ldform over #form2 -->
<input name="b">
</form>
</form>
root: base element for this form. HTMLElement or CSS Selector. Required.
init(): init function.
verify(name, value, element): validation function.
getFields(root): customized rules for getting fields.
input: root - root element for ldform
return: fields object ( see below )
if omitted, default to use selector \*[name]
names(status, fields): return list of name for fields to check. if omitted, default to all fields.
afterCheck(status, fields): custom function for doing anything after check
debounce(n, s): should check call debounce?
values: hash object with default values for corresponding keys.
submit: specify the element to be un-disabled when form is validated.
initCheck: force a checkAll at initialization.
An object with each key corresponding to a field and value of that key corresponding to field status. For example:
{
"name": 0,
"password": 2,
"recaptcha": 3,
"newsletter": 1
}
The values have following meaning:
An object containing fields elements, such as:
{
"name": ...,
"password": ...,
"recaptcha": ...,
"newsletter": ...
}
ready(): return true if form is valid and ready to engage.
check({n, now}): check fields for all touched fields. if n is provided, touch the field named n.
if now = true, check immediately without debouncing.
to check multiple fields, provide a list:
check([{...}, {...}, ... ])
values(o)
on(event-name, cb): listen to event "event-name" by callback cb. current supported event:
reset(): clear form fields and reset status ( clear is-invalid / is-valid classes )
field(n): get input field with name 'n'
checkAll(): force check all fields immediately. useful in programmatically input fields.
getfd(): get FormData object corresponding to all fields in this form.
MIT License
FAQs
form validation tool
The npm package ldform receives a total of 20 weekly downloads. As such, ldform popularity was classified as not popular.
We found that ldform 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
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.