Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@bpmn-io/form-js
Advanced tools
View, edit and simulate JSON-based forms.
This library exports a form viewer, editor and playground.
Renders a form based on a form schema and existing data:
import { Form } from '@bpmn-io/form-js';
const schema = {
type: 'default',
components: [
{
key: 'creditor',
label: 'Creditor',
type: 'textfield',
validate: {
required: true,
},
},
],
};
const data = {
creditor: 'John Doe Company',
};
const form = new Form({
container: document.querySelector('#form'),
});
await form.importSchema(schema, data);
form.on('submit', (event) => {
console.log(event.data, event.errors);
});
See viewer documentation for further details.
Create a new form or edit an exsting one:
import { FormEditor } from '@bpmn-io/form-js';
const formEditor = new FormEditor({
container: document.querySelector('#form-editor'),
});
await formEditor.importSchema(schema);
See editor documentation for further details.
Create and simulate a form with input and output data:
import { FormPlayground } from '@bpmn-io/form-js';
const schema = {
type: 'default',
components: [
{
key: 'creditor',
label: 'Creditor',
type: 'textfield',
validate: {
required: true,
},
},
],
};
const data = {
creditor: 'John Doe Company',
};
const formPlayground = new FormPlayground({
container: document.querySelector('#form-playground'),
schema,
data,
});
See playground documentation for further details.
Use the getSchemaVariables
util to retrieve the variables defined in a form schema. This is useful to gather what data is consumed and produced by a form.
import { getSchemaVariables } from '@bpmn-io/form-js';
const variables = getSchemaVariables(schema);
console.log('Schema variables', variables);
It is also possible to distinct between input and output variables:
import { getSchemaVariables } from '@bpmn-io/form-js';
const outputVariables = getSchemaVariables(schema, { inputs: false });
const inputVariables = getSchemaVariables(schema, { outputs: false });
Use under the terms of the bpmn.io license.
FAQs
View and edit forms - powered by bpmn.io
The npm package @bpmn-io/form-js receives a total of 3,446 weekly downloads. As such, @bpmn-io/form-js popularity was classified as popular.
We found that @bpmn-io/form-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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 found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.