Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Schema-based run time validation engine, made to integrate back and front-end validations using Mongoose like schemas.
Meant to integrate React Controled Forms
with back-end APIs using MongoDB.
It IS NOT intended to do magic and generate automatically HTML forms, fields, nor styles, or React components for you.
It DOES provide an easy way to parse and validate the same Mongoose Schema using React & Hooks
, integrating back and front-end validations in the same source of truth.
IMPORTANT Note: 🐻 Mongoose lib isn't required at the front-side at all, you can use any schemas following these guide lines, and validate them using Mongoose built in validators at the back-end side.
Basic example:
import React, { useState } from 'react';
import { useFormoose } from 'formoose';
const schema = () => ({
name: {
max: 50,
required: true,
type: String
}
});
function FormooseFormExample() {
const {
formData,
validateAllFieldsSync,
setProps
} = useFormoose(schema(), t);
const handleSubmit = async e => {
e.preventDefault();
let formIsValid;
try {
formIsValid = await validateAllFieldsSync();
} catch (error) {
console.error(error);
}
if (formIsValid) {
alert('We are good to go!');
} else {
alert('oops, something went wrong.');
}
};
return(
<form onSubmit={handleSubmit}>
<input type="text" placeholder="Name" {...setProps('name')} />
<label htmlFor="name">{t(formData.name.message)}</label>
<button type="submit">Submit</button>
</form>
);
}
export default FormooseFormExample;
Examples available at https://github.com/romulobordezani/formoose-example or at this sand box
Fell free to fork and submit changes and improvements, also please let me know if you find any issues.
Install dependencies.
yarn
yarn dev
Type Script will compile to dist
folder, use yarn link
.
Go to the example repository and run:
yarn link formoose
Run yarn start
and the browser should open with some examples using your local Formoose's code. Now you can test and debug your changes.
So, you reached the end of these documentation and still thinks that Formoose is not for you?
No problem! If you aren't interested in using Mogoose schemas
to control your forms, or i18n
to provide instant translations to your forms, or in the Type Script definitions to provide you a great Development Experience - in a really small package.
Probably you are looking for something else like:
And to use it with react-hook-form.com or formik
Hope it helps 🍀.
FAQs
Schema-based run time validation engine, made to integrate back and front-end validations using Mongoose like schemas.
We found that formoose 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.